projet_fil_red_api/node_modules/side-channel-list
2025-07-08 22:47:52 +02:00
..
.github Initial Commit 2025-07-08 22:47:52 +02:00
test Initial Commit 2025-07-08 22:47:52 +02:00
.editorconfig Initial Commit 2025-07-08 22:47:52 +02:00
.eslintrc Initial Commit 2025-07-08 22:47:52 +02:00
.nycrc Initial Commit 2025-07-08 22:47:52 +02:00
CHANGELOG.md Initial Commit 2025-07-08 22:47:52 +02:00
index.d.ts Initial Commit 2025-07-08 22:47:52 +02:00
index.js Initial Commit 2025-07-08 22:47:52 +02:00
LICENSE Initial Commit 2025-07-08 22:47:52 +02:00
list.d.ts Initial Commit 2025-07-08 22:47:52 +02:00
package.json Initial Commit 2025-07-08 22:47:52 +02:00
README.md Initial Commit 2025-07-08 22:47:52 +02:00
tsconfig.json Initial Commit 2025-07-08 22:47:52 +02:00

side-channel-list Version Badge

github actions coverage License Downloads

npm badge

Store information about any JS value in a side channel, using a linked list.

Warning: this implementation will leak memory until you delete the key. Use side-channel for the best available strategy.

Getting started

npm install --save side-channel-list

Usage/Examples

const assert = require('assert');
const getSideChannelList = require('side-channel-list');

const channel = getSideChannelList();

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