@ededejr/ms
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

ms

a utility for converting time descriptions (i.e "2hrs 30mins") into milliseconds.

Installation

npm install @ededejr/ms

Usage

import { ms } from "@ededejr/ms";

ms("1 min"); // 60000
What can I parse?
Hours and minutes
ms("2hrs"); // 7200000
ms("2hrs 30mins"); // 9000000;
Days
ms("10 days"); // 864000000
ms("1 day 20hrs 40mins"); // 160800000
AM/PM Times
ms("10AM"); // ms from now till the next time it will be 10AM
ms("10:30PM"); // ms from now till the next time it will be 10:30PM

Readme

Keywords

none

Package Sidebar

Install

npm i @ededejr/ms

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

30.5 kB

Total Files

8

Last publish

Collaborators

  • dxede