@naturalcycles/time-lib
TypeScript icon, indicating that this package has built-in type declarations

3.5.3 • Public • Published

@naturalcycles/time-lib

Date/time API, based on Dayjs.

npm min.gz size code style: prettier

Why

  • Fixes TypeScript imports, regardless if esModuleInterop is used or not
  • Allows to use it as ESM package with tree-shaking (without breaking your TypeScript again)
  • Opinionated. Includes "needed" dayjs plugins by default.
  • Allows to "just import dayjs" and not worry about:
    • Loading plugins for all of your "entry points", such as startServer.ts, setupJest.ts, at every cron job, etc.
    • That plugins are loaded BEFORE they are used (dependent on import order)
    • That TypeScript types are not loaded with plugins
  • Extends dayjs with some useful functions (via Plugin interface)
  • Has working isoWeekday plugin
  • Has en-gb locale by default, so, default firstDayOfWeek is Monday

API

TODO

Readme

Keywords

Package Sidebar

Install

npm i @naturalcycles/time-lib

Weekly Downloads

207

Version

3.5.3

License

MIT

Unpacked Size

45.6 kB

Total Files

38

Last publish

Collaborators

  • kirillgroshkov
  • kribor