
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Addition-only asynchronous state based on static data stitching
import { make } from 'cagibi';
// Create a stitchable copy of your object
const profile = make({ name: 'Joe', posts: [] });
// Use your object as a reference to stitch a sub-object
const post = make({ title: 'A new post' }, profile.posts);
// Stitch them all to get the final object
const stitched = stitch(profile, post);
// => { name: 'Joe', posts: [{ title: 'A new post' }] }
npm i cagibi
/ yarn add cagibi
Cagibi's name comes from the french word used to call a small storeroom. Pronounced /kä'jēbē/
.
cagibi
?make
and stitch
.write
and read
.protect(target, ...keys)
to forbid changes on keys.cagibi
come in handy?Merging nested data structure through async channels (API, parallel threads or job queues) without willing to maintain a key-value store with primary keys linking records.
import { make } from 'cagibi';
const profile = make({ name: 'Joe', posts: [] });
// => { name: 'Joe', posts: [] }
const post = make({ title: 'A new post' }, profile.posts);
import { stitch } from 'cagibi';
const stitched = stitch(profile, post);
Returns stitched state:
{
"name": "Joe",
"posts": [{ "title": "A new post" }]
}
import { make, stitch, write, read } from 'cagibi';
const stack = [];
const profile = make({ name: 'Joe', posts: [] });
const post = make({ title: 'A new post' }, profile.posts);
stack.push(write(profile));
stack.push(write(post));
// ...
// And only later on or in another environment
const profile = read(profileWritten);
const post = read(postWritten);
const stitched = stitch(profile, post);
Returns stitched state:
{
"name": "Joe",
"posts": [{ "title": "A new post" }]
}
import { make, stitch, write, read, Patches } from 'cagibi';
const patches = new Patches();
const profile = make({ name: 'Joe', posts: [] });
const post = make({ title: 'A new post' }, profile.posts);
patches.push(profile, post);
const savedPatches = patches.write();
// ...
// And only later on or in another environment
const importedPatches = new Patches();
importedPatches.read(savedPatches);
const stitched = importedPatches.stitch();
Returns stitched state:
{
"name": "Joe",
"posts": [{ "title": "A new post" }]
}
FAQs
Tiny asynchronous state management based on static data stitching
We found that cagibi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.