{"_id":"global-cache","_rev":"3923408","name":"global-cache","description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2025-09-01T01:26:38.000Z","created":"2015-07-02T07:19:36.331Z","1.2.1":"2017-07-20T23:28:12.579Z","1.2.0":"2016-04-06T08:12:37.065Z","1.1.0":"2016-01-30T02:34:48.662Z","1.0.3":"2015-10-20T04:34:34.357Z","1.0.2":"2015-10-14T22:33:47.453Z","1.0.1":"2015-08-12T23:37:51.824Z","1.0.0":"2015-07-02T07:19:36.331Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"versions":{"1.2.1":{"name":"global-cache","version":"1.2.1","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"pretest":"npm run --silent lint && npm run --silent coverage","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"node --es-staging test.js","coverage":"npm run --silent cover:clean && npm run --silent cover:istanbul && npm run --silent cover:check","cover:clean":"rimraf coverage","cover:istanbul":"istanbul cover test.js --report html","cover:check":"istanbul check","cover:covert":"covert test.js","lint":"npm run --silent jscs && npm run --silent eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.2","is-symbol":"^1.0.1"},"devDependencies":{"@ljharb/eslint-config":"^12.1.0","covert":"^1.1.0","eslint":"^4.2.0","istanbul":"^1.0.0-alpha.2","jscs":"^3.0.7","nsp":"^2.6.3","replace":"^0.3.0","rimraf":"^2.6.1","semver":"^5.3.0","tape":"^4.7.0"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"782d44c81a7970c88f5e10be4d40dad71f296653","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.2.1","_npmVersion":"5.3.0","_nodeVersion":"8.2.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"39ca020d3dd7b3f0934c52b75363f8d53312c16d","size":9431,"noattachment":false,"key":"/global-cache/-/global-cache-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.2.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-cache-1.2.1.tgz_1500593291677_0.1455861229915172"},"directories":{},"publish_time":1500593292579,"_hasShrinkwrap":false,"_cnpm_publish_time":1500593292579,"_cnpmcore_publish_time":"2021-12-16T16:20:31.795Z"},"1.2.0":{"name":"global-cache","version":"1.2.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"pretest":"parallelshell 'npm run --silent lint' 'npm run --silent cover'","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"node --es-staging test.js","cover":"npm run --silent cover:clean && npm run --silent cover:istanbul && npm run --silent cover:check","cover:clean":"rimraf coverage","cover:istanbul":"istanbul cover test.js --report html","cover:check":"istanbul check","cover:covert":"covert test.js","lint":"npm run --silent jscs && npm run --silent eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.2","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.5.1","covert":"^1.1.0","jscs":"^2.11.0","nsp":"^2.3.0","eslint":"^2.7.0","@ljharb/eslint-config":"^2.2.0","replace":"^0.3.0","semver":"^5.1.0","istanbul":"^1.0.0-alpha.2","rimraf":"^2.5.2","parallelshell":"^2.0.0"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"d816f1ae0cc841ee620a71e50461eefe87c1c709","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.2.0","_shasum":"bf7f4178a389c8ee513001a7a2e8d3253cc4ad8c","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"bf7f4178a389c8ee513001a7a2e8d3253cc4ad8c","size":8588,"noattachment":false,"key":"/global-cache/-/global-cache-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.2.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/global-cache-1.2.0.tgz_1459930354769_0.4319283738732338"},"directories":{},"publish_time":1459930357065,"_hasShrinkwrap":false,"_cnpm_publish_time":1459930357065,"_cnpmcore_publish_time":"2021-12-16T16:20:32.008Z"},"1.1.0":{"name":"global-cache","version":"1.1.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && npm run tests-only && npm run security","tests-only":"node --es-staging test.js","coverage":"covert test.js","coverage-quiet":"covert test.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.2","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.4.0","covert":"^1.1.0","jscs":"^2.9.0","nsp":"^2.2.0","eslint":"^1.10.3","@ljharb/eslint-config":"^1.6.1","replace":"^0.3.0","semver":"^5.1.0"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"f93c2bd8b4e43826a5d9e77adb20cacca62a892c","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.1.0","_shasum":"0e592ea545b0e9e9b7afddd13b6f17a425e474da","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"0e592ea545b0e9e9b7afddd13b6f17a425e474da","size":7561,"noattachment":false,"key":"/global-cache/-/global-cache-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.1.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1454121288662,"_hasShrinkwrap":false,"_cnpm_publish_time":1454121288662,"_cnpmcore_publish_time":"2021-12-16T16:20:32.242Z"},"1.0.3":{"name":"global-cache","version":"1.0.3","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && node --es-staging test.js && npm run security","coverage":"covert test.js","coverage-quiet":"covert test.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.2","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.2.1","covert":"^1.1.0","jscs":"^2.3.4","nsp":"^1.1.0","eslint":"^1.7.1","@ljharb/eslint-config":"^1.4.1","replace":"^0.3.0","semver":"^5.0.3"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"d17cf1cf5fb745543a16d115675b67128452aab6","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.0.3","_shasum":"4cc9697d76c566f72364190e84d1f50610b44bb1","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"4cc9697d76c566f72364190e84d1f50610b44bb1","size":7084,"noattachment":false,"key":"/global-cache/-/global-cache-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.0.3.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1445315674357,"_hasShrinkwrap":false,"_cnpm_publish_time":1445315674357,"_cnpmcore_publish_time":"2021-12-16T16:20:32.608Z"},"1.0.2":{"name":"global-cache","version":"1.0.2","author":{"name":"Jordan Harband"},"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && node --es-staging test.js && npm run security","coverage":"covert test.js","coverage-quiet":"covert test.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.2","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.2.1","covert":"^1.1.0","jscs":"^2.3.1","nsp":"^1.1.0","eslint":"^1.6.0","@ljharb/eslint-config":"^1.3.0","replace":"^0.3.0","semver":"^5.0.3"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"c2e3cf642c6cda4241ff538af3c332949bfd3643","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.0.2","_shasum":"c0bfdcaa5fa121d3115991d40652e44a1115baaa","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"c0bfdcaa5fa121d3115991d40652e44a1115baaa","size":6905,"noattachment":false,"key":"/global-cache/-/global-cache-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.0.2.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1444862027453,"_hasShrinkwrap":false,"_cnpm_publish_time":1444862027453,"_cnpmcore_publish_time":"2021-12-16T16:20:32.846Z"},"1.0.1":{"name":"global-cache","version":"1.0.1","author":{"name":"Jordan Harband"},"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && node --es-staging test.js && npm run security","coverage":"covert test.js","coverage-quiet":"covert test.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.1","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.1.0","covert":"^1.1.0","jscs":"^2.1.0","nsp":"^1.0.3","eslint":"^1.1.0","@ljharb/eslint-config":"^1.0.4","replace":"^0.3.0","semver":"^5.0.1"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"930a0c69182771355b889edee39867c1e985878c","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.0.1","_shasum":"2d35a6dc49c1461e7658c23c8612cb035cf95edd","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"2d35a6dc49c1461e7658c23c8612cb035cf95edd","size":6707,"noattachment":false,"key":"/global-cache/-/global-cache-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.0.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1439422671824,"_hasShrinkwrap":false,"_cnpm_publish_time":1439422671824,"_cnpmcore_publish_time":"2021-12-16T16:20:33.121Z"},"1.0.0":{"name":"global-cache","version":"1.0.0","author":{"name":"Jordan Harband"},"description":"Sometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && node --es-staging test.js && npm run security","coverage":"covert test.js","coverage-quiet":"covert test.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test.js *.js","eslint":"eslint test.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/global-cache.git"},"keywords":["global","window","self","cache","global object"],"dependencies":{"define-properties":"^1.1.0","is-symbol":"^1.0.1"},"devDependencies":{"tape":"^4.0.0","covert":"^1.1.0","jscs":"^1.13.1","nsp":"^1.0.3","eslint":"^0.24.0","replace":"^0.3.0","semver":"^4.3.6"},"testling":{"files":"test.js","browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"f937f7a8c6e8af30c330f628c03355069c4f0cca","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"homepage":"https://github.com/ljharb/global-cache#readme","_id":"global-cache@1.0.0","_shasum":"1b525fb1026e1fbf2247473f15191fcda3e3fc98","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"1b525fb1026e1fbf2247473f15191fcda3e3fc98","size":9720,"noattachment":false,"key":"/global-cache/-/global-cache-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-cache/download/global-cache-1.0.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1435821576331,"_hasShrinkwrap":false,"_cnpm_publish_time":1435821576331,"_cnpmcore_publish_time":"2021-12-16T16:20:33.332Z"}},"readme":"# global-cache <sup>[![Version Badge][2]][1]</sup>\n\n[![Build Status][3]][4]\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\n[![browser support][9]][10]\n\nSometimes you have to do horrible things, like use the global object to share a singleton. Abstract that away, with this!\n\nThis attaches a cache to the global object. It attempts to make it as undiscoverable as possible:\n - uses Symbols if available\n - if not, uses a string key that is not a valid identifier, so as not to show up in dot-notation browser autocomplete\n - makes it non-enumerable if property descriptors are supported\n\nKeys are required to be strings or symbols.\n\n## Example\n\n```js\nvar cache = require('global-cache');\nvar assert = require('assert');\n\nvar value = {};\nassert(cache.get(key) === undefined);\nassert(cache.has(key) === false);\n\ncache.set(key, value);\nassert(cache.get(key) === value);\nassert(cache.has(key) === true);\n\ncache.delete(key);\nassert(cache.get(key) === undefined);\nassert(cache.has(key) === false);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/global-cache\n[2]: http://versionbadg.es/ljharb/global-cache.svg\n[3]: https://travis-ci.org/ljharb/global-cache.svg\n[4]: https://travis-ci.org/ljharb/global-cache\n[5]: https://david-dm.org/ljharb/global-cache.svg\n[6]: https://david-dm.org/ljharb/global-cache\n[7]: https://david-dm.org/ljharb/global-cache/dev-status.svg\n[8]: https://david-dm.org/ljharb/global-cache#info=devDependencies\n[9]: https://ci.testling.com/ljharb/global-cache.png\n[10]: https://ci.testling.com/ljharb/global-cache\n[11]: https://nodei.co/npm/global-cache.png?downloads=true&stars=true\n[license-image]: http://img.shields.io/npm/l/global-cache.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/global-cache.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=global-cache\n","_attachments":{},"homepage":"https://github.com/ljharb/global-cache#readme","bugs":{"url":"https://github.com/ljharb/global-cache/issues"},"license":"MIT"}