time-unit
v1.1.0
Published
time unit conversion utility
Downloads
8
Readme
time-unit
Time Unit Conversion utility that mimics the conversion functionality of Java's TimeUnit class.
Features
- Easy to use
- Parses strings with time units
- Low overhead
- No dependencies
Installation
Install via npm.
npm install time-unit --save
Getting Started
To use time unit in your project:
const TimeUnit = require( 'time-unit' );
let milliseconds = TimeUnit.seconds.toMillis( 1 );
// milliseconds = 1000
let minutes = TimeUnit.hours.toMinutes( 1 );
// minutes = 60
let milliseconds = TimeUnit.milliseconds.parse( '1s' );
// milliseconds = 1000
Feedback
We'd love to get feedback on how to make this tool better. Feel free to contact us at [email protected]