Tiny date/time formatter (~1KB minified) with a simple template-based API. Current stable version is 1.6.4, with no updates since 2020. It is in maintenance mode. It provides Moment.js-like formatting strings (e.g., {yyyy}, {mm}, {Month}) but at a fraction of the size. Unlike Luxon or date-fns, it focuses on minimal bundle size and straightforward formatting. It ships with TypeScript declarations, supports both CommonJS and ES module via conditional exports.
npm install s-dateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage with default import, format string with tokens, and passing a Date object.
Use new Date(year, monthIndex, day) with monthIndex = actualMonth - 1.
Consider migrating to actively maintained libraries like date-fns or dayjs for broader support.
Use exact token names as documented: lowercase for most, {Month}, {Weekday}, etc. with capital first letter.Always provide a format string. Example: date('{yyyy}-{mm}-{dd}', new Date())Use default import: import date from 's-date'
Set 'esModuleInterop': true in tsconfig.json and use import date from 's-date'.
Use const date = require('s-date')No dependency data recorded yet.