🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

lit-date

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-date

Light-weight, faster datetime formatter for modern browsers

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
697
7.4%
Maintainers
1
Weekly downloads
 
Created
Source

⏰ lit-date

NPM filesize codecov

Light-weight, faster datetime formatter for modern browsers.

lit-date is ...

  • ⏰ Formatter for Date object
  • 👼 Light-weight (~1kB gzipped!)
  • 🦄 Very faster than other datetime libraries (e.g. moment)
  • 🆕 Powered by Template literals

Install

Node.js

npm i --save lit-date
# -- OR --
yarn add lit-date

Browser

<script src="https://unpkg.com/lit-date"></script>
<script type="module">
  import litdate from 'https://unpkg.com/lit-date?module';
</script>

Usage

const text = litdate`${'YYYY'}/${'MM'}/${'DD'}`(new Date());
console.log(text);
// i18n
const dayOfWeek = ({ dayOfWeek }) => [...'日月火水木金土'][dayOfWeek];
const format = litdate`${'M'}${'D'}${dayOfWeek}曜日`;
console.log(format(new Date()));

See examples.

Benchmark

See benchmarks for more details.

Basic usage

  • new Date() -> 2000/01/06
ChromeFirefox
Basic usage / ChromeBasic usage / Firefox

Advanced usage

  • new Date() -> 1月6日(木)
ChromeFirefox
Advanced usage / ChromeAdvanced usage / Firefox

Bundle size

sizegzip
tinydatetinydate_sizetinydate_gzip
time-stamptime-stamp_sizetime-stamp_gzip
lit-datelit-date_sizelit-date_gzip
tinytimetinytime_sizetinytime_gzip
date-formatdate-format_sizedate-format_gzip
dateformatdateformat_sizedateformat_gzip
formatoidformatoid_sizeformatoid_gzip
fechafecha_sizefecha_gzip
dayjsdayjs_sizedayjs_gzip
date-fnsdate-fns_sizedate-fns_gzip
luxonluxon_sizeluxon_gzip
momentmoment_sizemoment_gzip

Contribute

PRs accepted.

License

MIT (c) 3846masa

Keywords

date

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts