A lightweight, type-safe date manipulation library for JavaScript and TypeScript applications.
- 🔄 Date arithmetic (add/subtract days, months, years)
- 📝 Parse and format dates with ease
- ⚖️ Compare dates ( before, after, equal)
- ✅ Validate dates and check leap years
- 🕒 Unix timestamp conversion
- 🛠️ Utility functions (start/end of day, month)
- 📦 Zero dependencies
- 💪 Full TypeScript support
npm install d8r
# or
yarn add d8r// Modern ES imports
import { parseDate, formatDate } from 'd8r';
// Parse dates
const date = parseDate('2024-01-15', 'YYYY-MM-DD');
console.log(formatDate(date, { format: 'DD/MM/YYYY' })); // "15/01/2024"
// Date arithmetic
import { addDays } from 'd8r/core';
const futureDate = addDays(date, 5);The library is almost production-ready with: ✅ Type definitions ✅ Test coverage ✅ Build configuration ✅ Package exports ✅ Documentation
Final checklist before publishing:
- Run
npm run test(verify all tests pass) - Run
npm run build(check dist output) - Run
npm pack(test package locally) - Review documentation
- Check bundle size with
npm run analyze
Would you like me to help implement any of these final items?