Socket
Book a DemoInstallSign in
Socket

time-unit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-unit

time unit conversion utility

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

time

FAQs

Package last updated on 27 Jun 2016

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