the-tip-top-backend/backend/node_modules/side-channel
2025-10-16 00:58:52 +00:00
..
.github Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
test Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
.editorconfig Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
.eslintrc Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
.nycrc Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
CHANGELOG.md Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
index.d.ts Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
index.js Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
LICENSE Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
package.json Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
README.md Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00
tsconfig.json Initialisation du projet The Tip Top 2025-10-16 00:58:52 +00:00

side-channel Version Badge

github actions coverage License Downloads

npm badge

Store information about any JS value in a side channel. Uses WeakMap if available.

Warning: in an environment that lacks WeakMap, this implementation will leak memory until you delete the key.

Getting started

npm install --save side-channel

Usage/Examples

const assert = require('assert');
const getSideChannel = require('side-channel');

const channel = getSideChannel();

const key = {};
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);

channel.set(key, 42);

channel.assert(key); // does not throw
assert.equal(channel.has(key), true);
assert.equal(channel.get(key), 42);

channel.delete(key);
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);

Tests

Clone the repo, npm install, and run npm test