{"_id":"keykey","_rev":"363724","name":"keykey","description":"The JavaScript guru's KeyMirror-alternative. Functionally create constant hashes from any JavaScript object with greater performance.","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"time":{"modified":"2021-07-13T11:38:26.000Z","created":"2015-02-23T03:53:08.525Z","3.0.0":"2020-02-28T21:57:38.515Z","3.0.0-alpha.0":"2020-02-24T20:54:24.615Z","2.1.1":"2015-11-30T03:32:12.417Z","2.1.0":"2015-11-22T07:34:59.129Z","1.0.0":"2015-02-23T03:53:08.525Z"},"users":{"nelix":true},"author":{"name":"James J. Womack"},"repository":{"type":"git","url":"git+https://github.com/jameswomack/keykey.git"},"versions":{"3.0.0":{"name":"keykey","version":"3.0.0","description":"The JavaScript guru's KeyMirror-alternative. Functionally create constant hashes from any JavaScript object with greater performance.","main":"index.js","scripts":{"build":"babel src --out-dir lib","pretest":"npm run build","prepublish":"npm run test","test":"mocha test/test.js"},"repository":{"type":"git","url":"git+https://github.com/jameswomack/keykey.git"},"keywords":["keymirror","constants","const","functional","flux","array","object","keys","values"],"author":{"name":"James J. Womack"},"contributors":[{"name":"Johan Meiring"}],"license":"MIT","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"homepage":"https://github.com/jameswomack/keykey","devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","chai":"3.4.1","mocha":"2.3.4"},"dependencies":{"core-js":"^3.6.4","lru-cache":"^5.1.1"},"browserslist":"node >= 6","engines":{"node":">=6"},"engineStrict":true,"gitHead":"95b5d7de112c864fd30f30305ae370ac01adecce","_id":"keykey@3.0.0","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"shasum":"ba20a0ec1d28e327f339a196451b3d3dc61ace3a","size":2843,"noattachment":false,"key":"/keykey/-/keykey-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/keykey/download/keykey-3.0.0.tgz"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"_npmUser":{"name":"jameswomack","email":"thedesignspecialist@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keykey_3.0.0_1582927058352_0.04366939208423681"},"_hasShrinkwrap":false,"publish_time":1582927058515,"_cnpm_publish_time":1582927058515},"3.0.0-alpha.0":{"name":"keykey","version":"3.0.0-alpha.0","description":"The JavaScript guru's KeyMirror-alternative. Functionally create constant hashes from any JavaScript object with greater performance.","main":"index.js","scripts":{"build":"babel src --out-dir lib","pretest":"npm run build","prepublish":"npm run test","test":"mocha test/test.js"},"repository":{"type":"git","url":"git+https://github.com/jameswomack/keykey.git"},"keywords":["keymirror","constants","const","functional","flux","array","object","keys","values"],"author":{"name":"James J. Womack"},"contributors":[{"name":"Johan Meiring"}],"license":"MIT","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"homepage":"https://github.com/jameswomack/keykey","devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","chai":"3.4.1","mocha":"2.3.4"},"dependencies":{"core-js":"^3.6.4","lru-cache":"^5.1.1"},"browserslist":"node >= 6","engines":{"node":">=6"},"engineStrict":true,"gitHead":"d2c3cc3ea82888ca78651c935951b4952c6451f9","_id":"keykey@3.0.0-alpha.0","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"shasum":"010b4ae528b69776e5256383ffc97e70e5dac207","size":2848,"noattachment":false,"key":"/keykey/-/keykey-3.0.0-alpha.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/keykey/download/keykey-3.0.0-alpha.0.tgz"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"_npmUser":{"name":"jameswomack","email":"me@jameswomack.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keykey_3.0.0-alpha.0_1582577664513_0.5743182507080116"},"_hasShrinkwrap":false,"publish_time":1582577664615,"_cnpm_publish_time":1582577664615},"2.1.1":{"name":"keykey","version":"2.1.1","description":"The JavaScript guru's KeyMirror-alternative. Functionally create constant hashes from any JavaScript object with greater performance.","main":"index.js","scripts":{"build":"babel src --out-dir lib","pretest":"npm run build","prepublish":"npm run test","test":"mocha test/test.js"},"repository":{"type":"git","url":"git+https://github.com/jameswomack/keykey.git"},"keywords":["keymirror","constants","const","functional","flux","array","object","keys","values"],"author":{"name":"James J. Womack"},"license":"MIT","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"homepage":"https://github.com/jameswomack/keykey","devDependencies":{"babel-cli":"6.2.0","babel-preset-es2015":"6.1.18","chai":"3.4.1","mocha":"2.3.4"},"dependencies":{"lru-cache":"3.2.0"},"gitHead":"659bb5637a7459844615d820913e20587e52a821","_id":"keykey@2.1.1","_shasum":"a2739051475f4a02cc8dde23b160b37eb4fe62af","_from":".","_npmVersion":"2.14.6","_nodeVersion":"0.12.7","_npmUser":{"name":"jameswomack","email":"me@jameswomack.com"},"dist":{"shasum":"a2739051475f4a02cc8dde23b160b37eb4fe62af","size":2696,"noattachment":false,"key":"/keykey/-/keykey-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/keykey/download/keykey-2.1.1.tgz"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"directories":{},"publish_time":1448854332417,"_cnpm_publish_time":1448854332417,"_hasShrinkwrap":false},"2.1.0":{"name":"keykey","version":"2.1.0","description":"The JavaScript guru's KeyMirror-alternative. Functionally create constant hashes from any JavaScript object with greater performance.","main":"index.js","scripts":{"build":"babel src --out-dir lib","pretest":"npm run build","prepublish":"npm run test","test":"mocha test/test.js"},"repository":{"type":"git","url":"git+https://github.com/jameswomack/keykey.git"},"keywords":["keymirror","constants","const","functional","flux","array","object","keys","values"],"author":{"name":"James J. Womack"},"license":"ISC","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"homepage":"https://github.com/jameswomack/keykey","devDependencies":{"babel-cli":"6.2.0","babel-preset-es2015":"6.1.18","chai":"3.4.1","mocha":"2.3.4"},"dependencies":{"lru-cache":"2.7.0"},"gitHead":"49abf0ece17fe393c179af2c1131315d6fa6fcb5","_id":"keykey@2.1.0","_shasum":"bdcb14d7442219d60fd440f3eb4ce3193e46b700","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"jameswomack","email":"me@jameswomack.com"},"dist":{"shasum":"bdcb14d7442219d60fd440f3eb4ce3193e46b700","size":3436,"noattachment":false,"key":"/keykey/-/keykey-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/keykey/download/keykey-2.1.0.tgz"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"directories":{},"publish_time":1448177699129,"_cnpm_publish_time":1448177699129,"_hasShrinkwrap":false},"1.0.0":{"name":"keykey","version":"1.0.0","description":"Create a key<->value mirror. Useful for contants. Inspired by keymirror in Flux.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/jameswomack/keykey.git"},"keywords":["keymirror","constants","const","flux","array","object","keys","values"],"author":{"name":"James J. Womack"},"license":"ISC","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"homepage":"https://github.com/jameswomack/keykey","devDependencies":{"chai":"^2.0.0","mocha":"^2.1.0"},"gitHead":"a36e6d9fcf55bc73c648f4feedae4602e7a8a150","_id":"keykey@1.0.0","_shasum":"7df7eb8a5a27631f4fbdff6f49237a7a0d1eca48","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.32","_npmUser":{"name":"jameswomack","email":"me@jameswomack.com"},"maintainers":[{"name":"jameswomack","email":"james@cirrostratusco.com"}],"dist":{"shasum":"7df7eb8a5a27631f4fbdff6f49237a7a0d1eca48","size":2371,"noattachment":false,"key":"/keykey/-/keykey-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/keykey/download/keykey-1.0.0.tgz"},"directories":{},"publish_time":1424663588525,"_cnpm_publish_time":1424663588525,"_hasShrinkwrap":false}},"readme":"# KeyKey\n\n\n[![Build Status via CodeShip](https://codeship.com/projects/a2a85c50-9d3b-0132-6acc-4ef4301ddd41/status?branch=master)](https://codeship.com)\n[![Build Status](https://travis-ci.org/jameswomack/keykey.svg?branch=master)](https://travis-ci.org/jameswomack/keykey)\n\n\n## The shaman's KeyMirror-alternative. \n* Create enumerations\n* Functional-programming friendly (pass keys individually or as an array)\n* Performs well in hot code paths\n* Works in Node and browsers via Browerify\n\n```javascript\n> require('keykey')( 'FOO', 'BAR', 'BAZ' )\n\n{\n\tFOO: 'FOO',\n\tBAR: 'BAR',\n\tBAZ: 'BAZ'\n}\n```\n\nKeyKey is a *micro utility module* which provides a consistent way to declare constants. KeyKey achieves a very simple task, but it tries to do so in a way that will encourage innovative use. KeyKey offers functional programming capabilities by allowing keys to be passed individually or via an array. KeyKey makes constants not just from strings, but also from any JavaScript object. It caches the resulting key mirrors, making subsequent calls faster. And this cache is accessible if needed, which could provide an interesting look into constants across your application. Check out the performance test in `/test`. \n\nPlus, hey—no unnecessary `null`s.\n\n## Install\n`npm install keykey`\n\n## Quick Start\n### Create constants with caching\n```javascript\nconst keykey = require('keykey')\n\n// Arrays of keys\nkeykey(['foo','bar','baz']) // result -> {foo:'foo',bar:'bar',baz:'baz'}\n\n// Individual keys\nkeykey('foo',true,'baz') // bools, if not in the final position, are treated as keys\n```\n### Bypass the cache\n```javascript\nkeykey(['foo','bar','baz'], false) // no get/set\nkeykey('foo','bar','baz', false) // bools in the final position are treated as a cache switch\n```\n\n### Clear the entire cache\n```javascript\nkeykey.reset() // or \nkeykey.resetCache()\n```\n","_attachments":{},"homepage":"https://github.com/jameswomack/keykey","bugs":{"url":"https://github.com/jameswomack/keykey/issues"},"license":"MIT"}