Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

toMs

Build Status Code Climate Coverage Status

NPM

Simple and human friendly millisecond implementation with awesome chaining. Thanks @subzey for a sketch and advise :D

Install

npm install to-ms

Examples

var toMs = require('to-ms');

setTimeout(
  function () {
    /* do something */
  }, toMs
    .hour()
    .minutes(15)
    .seconds(30)
);

Chaining

All methods are chainable. I mean, you can pretty simple write something like this:

var ms = toMs
  .days(30)
  .hours(10)
  .minutes(30)
  .seconds(45);

Browser Support

Just use window.toMs. To support legacy browsers you must use ES5-Shim.

Methods

  • toMs.second()
  • toMs.seconds(Number)
  • toMs.minute()
  • toMs.minutes(Number)
  • toMs.hour()
  • toMs.hours(Number)
  • toMs.day()
  • toMs.days(Number)
  • toMs.week()
  • toMs.weeks(Number)
  • toMs.year()
  • toMs.years(Number)

About

Tiny chained ms creation util for NodeJS and browsers

Resources

Releases

No releases published

Packages

No packages published