{"_id":"side-channel","_rev":"3689121","name":"side-channel","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2025-02-13T05:46:35.000Z","created":"2019-12-02T07:45:52.012Z","1.1.0":"2024-12-11T17:00:33.553Z","1.0.6":"2024-02-29T19:03:24.392Z","1.0.5":"2024-02-06T16:48:59.623Z","1.0.4":"2020-12-29T19:58:12.459Z","1.0.3":"2020-08-23T20:20:16.888Z","1.0.2":"2019-12-20T19:45:41.557Z","1.0.1":"2019-12-02T07:45:52.012Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"versions":{"1.1.0":{"name":"side-channel","version":"1.1.0","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"types":"./index.d.ts","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","prelint":"eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')","lint":"eslint --ext=js,mjs .","postlint":"tsc -p . && attw -P","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","dependencies":{"es-errors":"^1.3.0","object-inspect":"^1.13.3","side-channel-list":"^1.0.0","side-channel-map":"^1.0.1","side-channel-weakmap":"^1.0.2"},"devDependencies":{"@arethetypeswrong/cli":"^0.17.1","@ljharb/eslint-config":"^21.1.1","@ljharb/tsconfig":"^0.2.2","@types/object-inspect":"^1.13.0","@types/tape":"^5.6.5","auto-changelog":"^2.5.0","eclint":"^2.8.1","encoding":"^0.1.13","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0","typescript":"next"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"_id":"side-channel@1.1.0","gitHead":"d65a5e20fdd9a87c62b0c334e601275e1860c803","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"shasum":"c3fcff9c4da932784873335ec9765fa94ff66bc9","size":7750,"noattachment":false,"key":"/side-channel/-/side-channel-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.1.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/side-channel_1.1.0_1733936433390_0.5985940579488518"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-11T17:00:33.553Z","publish_time":1733936433553,"_source_registry_name":"default","_cnpm_publish_time":1733936433553},"1.0.6":{"name":"side-channel","version":"1.0.6","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{"./package.json":"./package.json",".":"./index.js"},"types":"./index.d.ts","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","prelint":"eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')","lint":"eslint --ext=js,mjs .","postlint":"tsc -p .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^21.1.0","@types/call-bind":"^1.0.5","@types/get-intrinsic":"^1.2.2","@types/object-inspect":"^1.8.4","@types/tape":"^5.6.4","aud":"^2.0.4","auto-changelog":"^2.4.0","eclint":"^2.8.1","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.7.5","typescript":"next"},"dependencies":{"call-bind":"^1.0.7","es-errors":"^1.3.0","get-intrinsic":"^1.2.4","object-inspect":"^1.13.1"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"_id":"side-channel@1.0.6","gitHead":"c9ac2b5ce66d0024d4590392ac4651db790dd0dc","_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"shasum":"abd25fb7cd24baf45466406b1096b7831c9215f2","size":8466,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.6.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.6_1709233404147_0.09441883501048087"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-02-29T19:03:24.392Z","publish_time":1709233404392,"_source_registry_name":"default","_cnpm_publish_time":1709233404392},"1.0.5":{"name":"side-channel","version":"1.0.5","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{"./package.json":"./package.json",".":[{"default":"./index.js"},"./index.js"]},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","prelint":"eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.4","auto-changelog":"^2.4.0","eclint":"^2.8.1","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.7.4"},"dependencies":{"call-bind":"^1.0.6","es-errors":"^1.3.0","get-intrinsic":"^1.2.4","object-inspect":"^1.13.1"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"_id":"side-channel@1.0.5","gitHead":"4d4f39b360bffd627b637ec31b37d17b02ed9fba","_nodeVersion":"21.6.0","_npmVersion":"10.2.4","dist":{"shasum":"9a84546599b48909fb6af1211708d23b1946221b","size":6631,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.5.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.5_1707238139477_0.8125806962076723"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-02-06T16:48:59.623Z","publish_time":1707238139623,"_source_registry_name":"default","_cnpm_publish_time":1707238139623},"1.0.4":{"name":"side-channel","version":"1.0.4","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{"./package.json":"./package.json",".":[{"default":"./index.js"},"./index.js"]},"scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^17.3.0","aud":"^1.1.3","auto-changelog":"^2.2.1","eslint":"^7.16.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.4","tape":"^5.0.1"},"dependencies":{"call-bind":"^1.0.0","get-intrinsic":"^1.0.2","object-inspect":"^1.9.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"5c3c3fe90858eff0dd5c24d1f6a8351f8810755e","_id":"side-channel@1.0.4","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"efce5c8fdc104ee751b25c58d4290011fa5ea2cf","size":5638,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.4.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.4_1609271892338_0.6413545452249854"},"_hasShrinkwrap":false,"publish_time":1609271892459,"_cnpm_publish_time":1609271892459},"1.0.3":{"name":"side-channel","version":"1.0.3","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{"./package.json":"./package.json",".":[{"default":"./index.js"},"./index.js"]},"scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^17.2.0","aud":"^1.1.2","auto-changelog":"^2.2.0","eslint":"^7.7.0","safe-publish-latest":"^1.1.4","tape":"^5.0.1"},"dependencies":{"es-abstract":"^1.18.0-next.0","object-inspect":"^1.8.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"22f79686135bc418165ff05d066518fe6c7d7ba1","_id":"side-channel@1.0.3","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"shasum":"cdc46b057550bbab63706210838df5d4c19519c3","size":4757,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.3.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.3_1598214016718_0.07108655703290734"},"_hasShrinkwrap":false,"publish_time":1598214016888,"_cnpm_publish_time":1598214016888},"1.0.2":{"name":"side-channel","version":"1.0.2","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{".":[{"default":"./index.js"},"./index.js"]},"scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^15.1.0","auto-changelog":"^1.16.2","eslint":"^6.7.2","safe-publish-latest":"^1.1.4","tape":"^4.12.0"},"dependencies":{"es-abstract":"^1.17.0-next.1","object-inspect":"^1.7.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"f68d532990cdd2e4e7542241787ea3d103340765","_id":"side-channel@1.0.2","_nodeVersion":"13.5.0","_npmVersion":"6.13.4","dist":{"shasum":"df5d1abadb4e4bf4af1cd8852bf132d2f7876947","size":4199,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.2.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.2_1576871141427_0.82681961516941"},"_hasShrinkwrap":false,"publish_time":1576871141557,"_cnpm_publish_time":1576871141557},"1.0.1":{"name":"side-channel","version":"1.0.1","description":"Store information about any JS value in a side channel. Uses WeakMap if available.","main":"index.js","exports":{".":[{"default":"./index.js"},"./index.js"]},"scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/ljharb/side-channel.git"},"keywords":["weakmap","map","side","channel","metadata"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"homepage":"https://github.com/ljharb/side-channel#readme","devDependencies":{"@ljharb/eslint-config":"^15.0.2","auto-changelog":"^1.16.2","eslint":"^6.7.2","safe-publish-latest":"^1.1.4","tape":"^4.11.0"},"dependencies":{"es-abstract":"^1.16.2","object-inspect":"^1.7.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"eeb5be33213cf47dc88c426bb5f2ab22bd8537df","_id":"side-channel@1.0.1","_nodeVersion":"13.2.0","_npmVersion":"6.13.1","dist":{"shasum":"4fb6c60e13bf4a69baf1b219c50b7feb87cf5c30","size":4071,"noattachment":false,"key":"/side-channel/-/side-channel-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/side-channel/download/side-channel-1.0.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/side-channel_1.0.1_1575272751876_0.5565220906335961"},"_hasShrinkwrap":false,"publish_time":1575272752012,"_cnpm_publish_time":1575272752012}},"readme":"# side-channel <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nStore information about any JS value in a side channel. Uses WeakMap if available.\n\nWarning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`.\n\n## Getting started\n\n```sh\nnpm install --save side-channel\n```\n\n## Usage/Examples\n\n```js\nconst assert = require('assert');\nconst getSideChannel = require('side-channel');\n\nconst channel = getSideChannel();\n\nconst key = {};\nassert.equal(channel.has(key), false);\nassert.throws(() => channel.assert(key), TypeError);\n\nchannel.set(key, 42);\n\nchannel.assert(key); // does not throw\nassert.equal(channel.has(key), true);\nassert.equal(channel.get(key), 42);\n\nchannel.delete(key);\nassert.equal(channel.has(key), false);\nassert.throws(() => channel.assert(key), TypeError);\n```\n\n## Tests\n\nClone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/side-channel\n[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg\n[deps-svg]: https://david-dm.org/ljharb/side-channel.svg\n[deps-url]: https://david-dm.org/ljharb/side-channel\n[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/side-channel.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=side-channel\n[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel\n[actions-url]: https://github.com/ljharb/side-channel/actions\n","_attachments":{},"homepage":"https://github.com/ljharb/side-channel#readme","bugs":{"url":"https://github.com/ljharb/side-channel/issues"},"license":"MIT"}