Novices Performing Miracles

    time-unit

    1.1.0 • Public • Published

    Build Status npm version

    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 feedback@vandium.io

    License

    BSD-3-Clause

    Install

    npm i time-unit

    DownloadsWeekly Downloads

    7

    Version

    1.1.0

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • richardhyatt