agozilla
v1.3.0
Published
Human-friendly date and time formatting for JavaScript. Zero dependencies, locale support and TypeScript ready.
Maintainers
Readme
🦖 Agozilla
Human-friendly date & time formatting for JavaScript.
A lightweight JavaScript library for formatting dates into natural, human-readable expressions.
No dependencies. Fast. TypeScript ready.
📦 Installation
npm install agozilla🚀 Quick Start
const agozilla = require("agozilla");
console.log(agozilla("2024-01-01"));
// 2 years ago
console.log(agozilla.fromNow("2024-01-01"));
// 2 years ago
console.log(
agozilla.duration(
"2020-01-01",
"2025-01-01"
)
);
// 5 years
console.log(
agozilla.until("2030-01-01")
);
// in 3 years
console.log(
agozilla.smart(new Date())
);
// Today✨ Features
- ⚡ Zero dependencies
- 🌍 Locale support
- 📦 TypeScript definitions
- ⏱ Relative time formatting
- 📅 Human-friendly dates
- 🧪 Jest tested
- ✅ GitHub Actions CI
📚 API
fromNow()
agozilla.fromNow(date);Returns:
2 years agoduration()
agozilla.duration(start, end);Returns:
5 years 3 monthsuntil()
agozilla.until(date);Returns:
in 2 monthssmart()
agozilla.smart(date);Returns:
Today
Yesterday
Tomorrow
5 years ago🌍 Locales
agozilla.fromNow(date, {
locale: "en"
});
agozilla.fromNow(date, {
locale: "es"
});
agozilla.fromNow(date, {
locale: "fr"
});🗺 Roadmap
- ✅ fromNow()
- ✅ duration()
- ✅ until()
- ✅ smart()
- ⏳ calendar()
- ⏳ live()
- ⏳ browser bundle
- ⏳ React package
🤝 Contributing
Contributions, feature requests and bug reports are welcome.
If you'd like to contribute, feel free to open an issue or submit a pull request.
📄 License
MIT © Prathvik Mehra
