吕君喜 406d880ac6 first | vor 3 Jahren | |
---|---|---|
.. | ||
test | vor 3 Jahren | |
.npmignore | vor 3 Jahren | |
.testem.json | vor 3 Jahren | |
.travis.yml | vor 3 Jahren | |
LICENCE | vor 3 Jahren | |
README.md | vor 3 Jahren | |
index.js | vor 3 Jahren | |
package.json | vor 3 Jahren | |
seed.js | vor 3 Jahren |
A requirable version of Date.now()
Use-case is to be able to mock out Date.now() using require interception.
var now = require("date-now")
var ts = now()
var ts2 = Date.now()
assert.equal(ts, ts2)
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()
npm install date-now