UNPKG

humanize-time-tool

Version:

A simple and lightweight Node.js library for human-friendly time formatting and localization.

78 lines (61 loc) 2.54 kB
# Changelog All notable changes to this project will be documented in this file. ## [1.3.1] - 2025-08-05 - Minor fixes. ## [1.3.0] - 2025-08-04 ### Added - Added support for additional languages: - Estonian (et) - Latvian (lv) - Lithuanian (lt) - Slovak (sk) - Hungarian (hu) - Serbian (sr) - Croatian (hr) - Ukrainian (uk) - Belarusian (be) - Bulgarian (bg) - Romanian (ro) - Thai (th) - Slovenian (sl) - Bosnian (bs) - Persian (fa) - Icelandic (is) ## [1.2.0] - 2025-08-04 ### Added - Added support for wildcard `'*'` in `allowedLanguages` to register all languages at once. - Allowed `allowedLanguages` parameter to be either an array of language codes or the wildcard `'*'`. - Middleware language registration logic now supports both specific language arrays and the wildcard. ## [1.1.3] - 2025-08-04 ### Fixed - Prevented duplicate registration of languages via `register()`. - Refactored `index.js` to support lazy-loaded language modules while keeping tree-shaking intact. - Improved clarity of internal `languageMap` and `availableLanguages` handling. - Cleaned up unnecessary imports in locale modules. ## [1.1.2] - 2025-08-04 ### Fixed - Further improved robustness of `timeAgo()` to gracefully handle edge cases. - Fixed occasional issues with date parsing and fallback translations. - Added more descriptive console warnings for missing or incomplete translation data. - Optimized JSON translation loading to prevent duplicate fetches. ## [1.1.1] - 2025-08-04 ### Fixed - Improved error handling when loading translation JSON files. - Added fallback handling for missing translation keys to avoid `undefined` outputs. - Enhanced `timeAgo()` to safely handle invalid dates and missing translation entries. - Added console warnings for missing or failed translation loads. ## [1.1.0] - 2025-08-03 ### Added - Server-side support for `timeAgo()` in Express applications. - Improved handling of fallback translations and console warnings. - Example usage of `timeAgo` in a real Express environment. ## [1.0.0] - 2025-08-03 ### Added - Initial release of the **humanize-time-tool** library. - Support for formatting timestamps as human-friendly "time ago" strings. - Localization support for multiple languages. - Default translations for 23 languages. - Customizable translation overrides. - Lightweight and easy integration for Node.js projects. - Basic API with `timeAgo`, `getTranslations`, and `setupLanguages` functions. - Clear error handling and warnings for missing translations.