{"name":"side-channel","version":"1.1.1","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.4","side-channel-list":"^1.0.1","side-channel-map":"^1.0.1","side-channel-weakmap":"^1.0.2"},"devDependencies":{"@arethetypeswrong/cli":"^0.18.3","@ljharb/eslint-config":"^22.2.3","@ljharb/tsconfig":"^0.3.2","@types/object-inspect":"^1.13.0","@types/tape":"^5.8.1","auto-changelog":"^2.6.0","eclint":"^2.8.1","encoding":"^0.1.13","eslint":"^8.57.1","in-publish":"^2.0.1","npmignore":"^0.3.5","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"},"gitHead":"3d260956bc92a85f140352bd814dc5c9d31fc65a","_id":"side-channel@1.1.1","_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==","shasum":"ea02c62e05dc4bea67d4442f0fb71ee192f8e0ab","tarball":"http://registry-npm.ywwl.com/side-channel/download/side-channel-1.1.1.tgz","fileCount":12,"unpackedSize":22864,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCUo9WjvpGwIzlT3I49FtvH9YMGmyGXTwP5A399OxedegIgfvSrOv5CyDD2JsIEoufWQ7p+G0iWkaNhmgH9G2B7gYk="}],"size":8083,"noattachment":false,"key":"/side-channel/-/side-channel-1.1.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/side-channel_1.1.1_1780950886866_0.9455968620475328"},"_hasShrinkwrap":false,"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/github/check-runs/ljharb/side-channel/main\n[actions-url]: https://github.com/ljharb/side-channel/actions\n","publish_time":1780950887001,"_cnpm_publish_time":1780950887001,"dist-tags":{"latest":"1.1.1"}}