
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A serializer/deserializer that can serialize pointer references and remember context.
npm install --save anslo
const Anslo = require("anslo");
/**
* Create an instance
**/
let anslo = new Anslo();
/**
* Create an instance of something
* you would like to serialize
**/
let user = new User();
/**
* Do cool things like self referencing
**/
user.self = user;
/**
* Serialize data down to a string
**/
let string = anslo.down(user)
/**
* Deserialize back to original state
**/
let newUser = anslo.up(string);
/**
* Done!!
**/
console.log(newUser === newUser.self); //outputs: true
const Anslo = require("anslo");
/**
* Create an instance
*
* [Context]
* Provide an object of constructors that
* you would like to have Anslo remember,
* and when they are revived, the pointer
* will be an instance of the context provided
**/
let anslo = new Anslo({ User });
/**
* Create an instance of something
* you would like to serialize
**/
let user = new User();
/**
* Do cool things like self referencing
**/
user.self = user;
/**
* Serialize data down to a string
**/
let string = anslo.down(user)
/**
* Deserialize back to original state
**/
let newUser = anslo.up(string);
/**
* Done!!
**/
console.log(newUser === newUser.self); //outputs: true
Serializing state down to a string and reviving it to its original state raises strong security concerns. If there are any questions at all about where serializations come from, use encryption and a signature to verify you made it. Moreover, we are soon to be living in an time where quantum computing is available; use a post-quantum algorithm.
"Be Kind andRewindEncrypt Everything"
Let's say we were to run this bit of code...
let data = [{
name: "something",
date: new Date()
}]
/**
* The second argument is the number of
* spaces used to beautify the serialization.
*/
let string = anslo.down(data, 4)
console.log(string);
{
"pointers": [
[],
{},
"something",
{}
],
"graph": {
"r": 0,
"t": "array",
"c": {
"0": {
"r": 1,
"t": "object",
"c": {
"name": {
"r": 2,
"t": "string"
},
"date": {
"r": 3,
"t": "date",
"v": "2018-12-10T06:36:05.620Z"
}
}
}
}
}
}
Minified, it would look like this.
{"pointers":[[],{},"something",{}],"graph":{"r":0,"t":"array","c":{"0":{"r":1,"t":"object","c":{"name":{"r":2,"t":"string"},"date":{"r":3,"t":"date","v":"2018-12-10T06:40:51.342Z"}}}}}}
FAQs
A json serializer/parser that can remember state.
The npm package anslo receives a total of 4 weekly downloads. As such, anslo popularity was classified as not popular.
We found that anslo 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’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.