Socket
Book a DemoInstallSign in
Socket

@bit-js/ms

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bit-js/ms

Optimized ms parser and serializer

1.0.2
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

MS

Optimized conversion from and to milliseconds.

To convert milliseconds to string:

// 172800000
toMs("2 days");

// 86400000
toMs("1d");

// 36000000
toMs("10h");

// 9000000
toMs("2.5 hrs");

// 7200000
toMs("2h");

// 60000
toMs("1m");

// 5000
toMs("5s");

// 31557600000
toMs("1y");

// 100
toMs("100");

// -259200000
toMs("-3 days");

// -3600000
toMs("-1h");

// -200
toMs("-200");

And convert from milliseconds to string:

// "1m"
formatMs(60000);

// "1 minute"
formatMsLong(60000);

FAQs

Package last updated on 24 Jun 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.