A modern, TypeScript-based CLI tool to convert CSV files to iCalendar (ICS) format.
- π Fast & Efficient: Built with modern Node.js and TypeScript
- π Standards Compliant: Generates valid iCalendar files
- π― Flexible: Support for custom delimiters and date formats
- π³ Docker Ready: Includes Dockerfile for containerized usage
- β Well Tested: Comprehensive test coverage with Vitest
- π¦ Type Safe: Full TypeScript support with type definitions
npm install -g csv2icalgit clone https://github.com/amine7536/csv2ical.js.git
cd csv2ical.js
npm install
npm run build
npm linkdocker pull ghcr.io/amine7536/csv2ical.js:latestcsv2ical -i input.csv -o output.ics -d "," -H| Option | Alias | Description | Default | Required |
|---|---|---|---|---|
-i |
--input |
Input CSV file | - | Yes |
-o |
--output |
Output ICS file | - | Yes |
-d |
--delimiter |
CSV delimiter character | , |
No |
-H |
--headers |
CSV contains headers | false |
No |
--rows |
- | Column indices for event fields | 0,1,2,3,4 |
No |
--dateformat |
- | Custom date format (moment.js style) | - | No |
Your CSV file should contain the following columns (in order):
- Subject: Event title/summary
- Start Date: Event start date and time
- End Date: Event end date and time
- Description: Event description
- Location: Event location
"Subject","Start Date","End Date","Description","Location"
"Team Meeting","2025-01-15 09:00","2025-01-15 10:00","Weekly sync","Conference Room A"
"Project Deadline","2025-01-20 17:00","2025-01-20 18:00","Submit deliverables","Office"
"Client Call","2025-01-22 14:00","2025-01-22 15:00","Q1 Review","Zoom"csv2ical -i events.csv -o calendar.ics -Hcsv2ical -i events.csv -o calendar.ics -d ";" -Hcsv2ical -i events.csv -o calendar.ics -H --dateformat="DD/MM/YYYY HH:mm"csv2ical -i events.csv -o calendar.ics -H --rows=0,2,3,1,4# Using docker run
docker run -v $(pwd)/data:/data ghcr.io/amine7536/csv2ical.js:latest \
-i /data/input.csv -o /data/output.ics -H
# Using docker-compose
docker-compose up- Node.js 18.x or higher
- npm or yarn
# Clone the repository
git clone https://github.com/amine7536/csv2ical.js.git
cd csv2ical.js
# Install dependencies
npm install
# Run in development mode
npm run dev| Script | Description |
|---|---|
npm run build |
Build the TypeScript project |
npm run dev |
Build in watch mode |
npm test |
Run tests |
npm run test:watch |
Run tests in watch mode |
npm run test:coverage |
Generate test coverage report |
npm run lint |
Lint the code |
npm run lint:fix |
Fix linting issues |
npm run format |
Format code with Prettier |
npm run format:check |
Check code formatting |
npm run typecheck |
Run TypeScript type checking |
npm run ci |
Run all checks (CI pipeline) |
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageThe project follows modern TypeScript best practices:
- TypeScript: Strict mode enabled for maximum type safety
- ESM Modules: Uses modern ES module syntax
- Testing: Vitest for fast, modern testing
- Linting: ESLint with TypeScript support
- Formatting: Prettier for consistent code style
- CI/CD: GitHub Actions for automated testing and deployment
- csv-parse: Modern CSV parser
- ical-generator: iCalendar file generator
- winston: Logging library
- yargs: Command-line argument parser
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All tests pass (
npm test) - Code is formatted (
npm run format) - No linting errors (
npm run lint) - TypeScript compiles (
npm run typecheck)
This project is licensed under the MIT License - see the LICENSE file for details.
Amine Benseddik
- Email: amine.benseddik@gmail.com
- GitHub: @amine7536
This tool is built with:
- π Complete rewrite in TypeScript
- β Added comprehensive test suite
- π³ Added Docker support
- π Added CI/CD with GitHub Actions
- π¦ Modern ESM module support
- π¨ Added ESLint and Prettier
- π Improved documentation
- Original JavaScript implementation