1.0.5 • Published 3 years ago

reset-date-cache v1.0.5

Weekly downloads
15
License
MIT
Repository
github
Last release
3 years ago

reset-date-cache

Build Status Coverage Status

Reset V8's date cache on demand.

The underlying call being made is quite expensive so it should only be used where absolutely necessary.

Install

$ npm install reset-date-cache

Test

$ npm i
$ npm test

Example

const reset = require('reset-date-cache')
const assert = require('assert')

var d = new Date('10/20/2015 8:50:00 AM UTC')
var orig = d.toString()

process.env.TZ = 'US/Hawaii'
reset()

var d2 = new Date('10/20/2015 8:50:00 AM UTC')
assert.equal(d2.toString(), 'Mon Oct 19 2015 22:50:00 GMT-1000 (HST)')

delete process.env.TZ

reset()

var d3 = new Date('10/20/2015 8:50:00 AM UTC')
assert.equal(d3.toString(), orig)

reset()

Author

Evan Lucas

License

MIT (See LICENSE for more info)

1.0.5

3 years ago

1.0.4

6 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago