
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
datemath-cli
Advanced tools
A beautiful command-line tool for date calculations in natural language. Calculate days between dates, add/subtract time periods, and get human-readable date information.
npm install -g datemath-cli
npm install
npm run dev
npx datemath-cli <command>
Run without any commands to launch the interactive calculator:
npx datemath-cli
# or if installed globally
datemath
This will launch the interactive calculator mode where you can choose operations and enter dates step-by-step.
datemath today
Output:
📅 Today is:
Friday, October 17, 2025
ISO format: 2025-10-17
datemath since 2025-01-01
Output:
📊 Time since Wednesday, January 1, 2025:
289 days
With verbose output:
datemath since 2025-01-01 -v
Output:
📊 Time since Wednesday, January 1, 2025:
289 days
= 41 weeks
= 9 months, 19 days
datemath to 2025-12-25
Output:
📊 Time until Thursday, December 25, 2025:
69 days
Alias:
datemath until 2025-12-25
datemath between 2025-01-01 2025-10-17
Output:
📊 Time between Wednesday, January 1, 2025 and Friday, October 17, 2025:
289 days
With specific unit:
datemath between 2025-01-01 2025-10-17 --unit weeks
Output:
41 weeks
Show all units:
datemath between 2025-01-01 2025-10-17 -v
Output:
📊 Time between Wednesday, January 1, 2025 and Friday, October 17, 2025:
289 days
41 weeks
9 months
0 years
9 months, 19 days
datemath add 2025-10-17 30 days
datemath add 2025-10-17 5 weeks
datemath add 2025-10-17 2 months
datemath add 2025-10-17 1 year
Output:
📊 Friday, October 17, 2025 + 30 days:
Saturday, November 16, 2025
ISO format: 2025-11-16
datemath subtract 2025-10-17 30 days
datemath sub 2025-10-17 5 weeks
Output:
📊 Friday, October 17, 2025 - 30 days:
Thursday, September 17, 2025
ISO format: 2025-09-17
datemath calc
This launches an interactive prompt where you can:
| Command | Description | Example |
|---|---|---|
today | Show today's date | datemath today |
since <date> | Days since a date | datemath since 2025-01-01 |
to <date> | Days until a date | datemath to 2025-12-25 |
until <date> | Alias for to | datemath until 2025-12-25 |
between <date1> <date2> | Time between dates | datemath between 2025-01-01 2025-10-17 |
add <date> <amount> <unit> | Add time to date | datemath add 2025-01-01 30 days |
subtract <date> <amount> <unit> | Subtract time from date | datemath sub 2025-01-01 30 days |
calc | Interactive calculator | datemath calc |
-v, --verbose - Show detailed breakdown (for since, to, between)-u, --unit <unit> - Specify unit: days, weeks, months, years (for between)-h, --help - Show help-V, --version - Show versionAll dates must be in ISO 8601 format: YYYY-MM-DD
Examples:
2025-10-17 ✅2025-01-01 ✅10/17/2025 ❌17-10-2025 ❌Supported units for add/subtract commands:
day or daysweek or weeksmonth or monthsyear or years# Clone the repository
git clone https://github.com/ahmadawais/datemath-cli.git
cd datemath-cli
# Install dependencies
npm install
# Run in development mode
npm run dev
npm run dev # Run in development mode with watch
npm run build # Build for production
npm test # Run tests once
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run typecheck # Type check without emitting
npm run lint # Lint code
npm run format # Format code with Prettier
datemath-cli/
├── src/
│ ├── index.ts # Main CLI entry point
│ └── index.test.ts # Test suite
├── dist/ # Compiled output (generated)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── tsup.config.ts # Build configuration
├── vitest.config.ts # Test configuration
└── README.md # This file
# Run all tests
npm test
# Watch mode (re-runs on file changes)
npm run test:watch
# Coverage report
npm run test:coverage
# Build the project
npm run build
# Test the built version locally
npm link
datemath today
# Update version
npm version patch # or minor, or major
# Build
npm run build
# Publish to npm
npm publish
# Push tags to git
git push --tags
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Ahmad Awais - Website · GitHub · Twitter
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or run into issues, please open an issue on GitHub.
Made with 💜 by Ahmad Awais
FAQs
A beautiful CLI for date calculations in natural language
We found that datemath-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.