Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

interval

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interval

Converts common units of time to milliseconds

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
decreased by-47.95%
Maintainers
2
Weekly downloads
 
Created
Source

interval

A small library for creating and using time intervals using common units of time instead.

NPM
Build Status devDependency Status Coverage Status

install

npm install interval --save

usage

var interval = require('interval');

// set timeouts and intervals more literately
setTimeout(foo, interval({ hours: 2 }));

// the date 10 days from today
var deadline = interval.add(new Date(), { days: 10 });

The supported units of time are:

  • 'weeks'
  • 'days'
  • 'hours'
  • 'minutes'
  • 'seconds'
  • 'milliseconds'

You can use as many or as few units as you want and they are applied cumulatively.

interval(object)
interval.fromMilliseconds(number)
interval.normalize(object)
interval.stringify(number|object)
interval.add(date|object, object)
interval.subtract(date|object, object)

Keywords

FAQs

Package last updated on 09 Dec 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc