reset-date-cache

1.0.5 • Public • Published

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)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.530latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.530
1.0.42
1.0.31
1.0.22
1.0.12
1.0.01

Package Sidebar

Install

npm i reset-date-cache

Weekly Downloads

38

Version

1.0.5

License

MIT

Unpacked Size

7.12 kB

Total Files

9

Last publish

Collaborators

  • evanlucas
  • eh
  • asimplesaurus