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

date-now

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-now

A requirable version of Date.now()

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1.3M
-16.12%
Maintainers
1
Weekly downloads
 
Created
Source

date-now

build status

browser support

A requirable version of Date.now()

Use-case is to be able to mock out Date.now() using require interception.

Example

var now = require("date-now")

var ts = now()
var ts2 = Date.now()
assert.equal(ts, ts2)

example of seed

var now = require("date-now/seed")(timeStampFromServer)

// ts is in "sync" with the seed value from the server
// useful if your users have their local time being a few minutes
// out of your server time.
var ts = now()

Installation

npm install date-now

Contributors

  • Raynos

MIT Licenced

FAQs

Package last updated on 11 Jun 2014

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