side-channel-map (1.0.1)

Published 2026-02-24 14:05:04 +00:00 by atheaadmin

Installation

registry=
npm install side-channel-map@1.0.1
"side-channel-map": "1.0.1"

About this package

side-channel-map Version Badge

github actions coverage License Downloads

npm badge

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

Warning: if the key is an object, this implementation will leak memory until you delete it. Use side-channel for the best available strategy.

Getting started

npm install --save side-channel-map

Usage/Examples

const assert = require('assert');
const getSideChannelMap = require('side-channel-map');

const channel = getSideChannelMap();

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

Dependencies

Dependencies

ID Version
call-bound ^1.0.2
es-errors ^1.3.0
get-intrinsic ^1.2.5
object-inspect ^1.13.3

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.1
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.2
@types/get-intrinsic ^1.2.3
@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
evalmd ^0.0.19
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
Details
npm
2026-02-24 14:05:04 +00:00
0
Jordan Harband
MIT
latest
5.2 KiB
Assets (1)
Versions (1) View all
1.0.1 2026-02-24