side-channel-list <sup>Version Badge</sup>

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

side-channel-list - Installation

To install side-channel-list via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install side-channel-list --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install side-channel-list

Learn more about the config option.

PNPM

pnpm install side-channel-list --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install side-channel-list --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

side-channel-list - Download

Download Tarball (v1.0.1)

Integrity sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==
SHASUM c2e0b5a14a540aebee3bbc6c3f8666cc9b509127
Tarball https://js.registry.sudovanilla.org/side-channel-list/-/side-channel-list-1.0.1.tgz