
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
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 0 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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.