saco-js
A bag-like data structure in JavaScript created to be compatible with node as well as deno
Documentation/Reference
Check the auto-generated reference. Create a local copy by doing
npm i -g jsdoc
# or
npm i
# and then
npm run doc
This will generate documentation in the doc
directory.
Example
import { sacoUnion, sacoIntersection } from "../index.js"; // Use published URL instead
const unSaco = { a: 3, b: 1 };
const otroSaco = { a: 1, b: 3 };
console.log(sacoUnion(unSaco, otroSaco)); // { a: 4, b: 4 }
console.log(sacoIntersection(unSaco, otroSaco)); // { a: 1, b:1 }
Or run
deno run examples/basic.js
or, with bun
bun run examples/basic.js
or obviously with node:
node examples/basic.js
from this directory.