
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
chainscript
Advanced tools
var Chainscript = require('chainscript-client');
// You pass the initial script
new Chainscript({document: {content: {name: 'My Document'}}})
// Add a snapshot command
.snapshot()
// Add a notarize command
.notarize()
// Add a send mail command
.email('stephan.florquin+test@gmail.com')
// Run the script (returns a promise)
.run()
.then(function(script) {
console.log(script.toJSON());
})
.fail(function(err) {
console.error(err.message);
});
var Chainscript = require('chainscript-client');
Chainscript.load('chainscript:document:3940c155-d17d-421a-b34e-8bf5a458299e')
.then(function(script) {
console.log(script.toJSON());
// You can add commands to the loaded script and run the script
return script
.email('stephan.florquin+test@gmail.com')
.run();
}).then(function(script) {
// New script executed with added commands
console.log(script.toJSON());
})
.fail(function(err) {
console.error(err.message);
});
Creates a new Chainscript from a JSON object.
If immutable is true, THE INSTANCE IS IMMUTABLE. It is never modified
after initialization. Adding commands to a script returns a new instance.
Loads an existing script. Returns a promise that resolves with an instance of
Chainscript.
Returns the value at specified path, or undefined if the path doesn't exist.
Ex:
var value = new Chainscript({document: {content: {name: 'My Document'}}})
.get('document.content.name'));
console.log(value); // My Document
Adds a snapshot command to a script. Returns a new instance of Chainscript
if immutable, otherwise returns the instance.
Adds an update command to a script. Returns a new instance of Chainscript
if immutable, otherwise returns the instance.
Adds a notarize command to a script. Returns a new instance of Chainscript
if immutable, otherwise returns the instance.
Adds a send_email command to a script. Returns a new instance of Chainscript
if immutable, otherwise returns the instance.
Adds an update command to a script that applies granular updates to the
document. Returns a new instance of Chainscript if immutable, otherwise
returns the instance.
Ex:
new Chainscript({document: {content: {name: 'My Document', val: true}}})
.change(function(doc) {
delete doc.val;
doc.name += ' V2';
doc.meta = {
author: 'Stephan Florquin',
time: Date.now()
};
})
.run()
.then(function(script) {
console.log(script.get('document.content'));
})
.fail(function(err) {
console.error(err.message);
});
Adds an update command to a script that applies the necessary changes to
update the current document to the given document. Returns a new instance of
Chainscript if immutable, otherwise returns the instance.
Ex:
var doc = {
name: 'My Document'
};
var script = new Chainscript({document: {content: doc}});
doc.name = 'My Document V2';
doc.meta = {
author: 'Stephan Florquin',
time: Date.now()
};
script.delta(doc).run().then(function(s) {
script = s;
console.log(script.get('document.content'));
});
Returns the script as a JSON object.
Runs the Chainscript. Returns a promise that resolves with a new instance of
Chainscript if immutable, otherwise with the instance.
Clones Chainscript. Returns a new instance of Chainscript.
This only applies when immutable is false.
You can change the document directly, and an update command will be issued when
you call run.
var script = new Chainscript(
{document: {content: {name: 'My Document'}}},
false
);
script.content.name += ' V2';
script.content.meta = {
author: 'Stephan Florquin',
time: Date.now()
};
script
.run()
.then(function() {
console.log(script.toJSON());
});
FAQs
Client for chainscript.io
The npm package chainscript receives a total of 59 weekly downloads. As such, chainscript popularity was classified as not popular.
We found that chainscript 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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.