1.0.1 • Published 3 years ago

@cit999/ms v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Millisecond Conversion Utility

Features

  • Can fetch all timestamps from a string and convert it
  • 100% Promise-based
  • Type declarations included for TypeScript users

Examples

ms("1 day") // 86400000
ms("1 second") // 1000
ms("1 day 10 hours") // 122400000
ms("100 ms") // 100

Format milliseconds to a string

format(1000, "long") // "1 second"
format(1000, "short") // "1s"
format(31557601000, "long") // "1 year 1 second"
format(31557601000, "short") // "1y 1s"