New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jstime

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstime

Convert numbers to milliseconds easily

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

JS Time

##Works both on Node and the browser

require('./lib/jsTime.js');
<script type="type/javascript" src="js/jsTime.js"></ script>

##After that you can do things like these:

setTimeout(function(){
	alert('After 10 seconds');
}, 10..seconds());

setInterval(function(){
	alert('Every 1.5 hours');
}, 1.5.minutes());

// Timestamp of 3 days from now
var expire = new Date() + 3..days();

The double dot (..) is needed for integer numbers, else the interpreter thinks it's a mistyped float number. Another possible syntax that is just a it longer but less magical would be:

var expire = new Date() + (3).days();

Pick the one you prefer.

##TODO

  • Add a getter version that only works on modern browsers

Keywords

number

FAQs

Package last updated on 13 May 2013

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