Provides time-period constants in milliseconds for JavaScript, exposed as functions to prevent silent NaN errors.
Periods is a lightweight JavaScript library that offers predefined time-period constants in milliseconds. It helps developers avoid common pitfalls when working with time calculations by providing a reliable and error-resistant API.
day(), week()) to catch typos early and prevent silent NaN errors in data.second() and seconds()) for intuitive usage.monthRough() and yearRough() methods using approximate multipliers (4.3 weeks per month, 365.25 days per year) for flexible time calculations.day(2) for two days) and integration with array methods like map().Periods prioritizes developer experience by reducing errors in time-based calculations through a simple, function-driven design that fails loudly instead of silently.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.