Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
eval-serializer
Advanced tools
Readme
Easier to write serializations
You have tons of big configuration blob and want to have some good syntax on it. Usually it's not well supported for most of applications. I see visual studio provides great configuration with autocomplete feature, but it was burdensome for individual developer who wants to minimize requirements.
This project leverage JavaScript code evaluation(eval
, but with some
sandboxing), to allow configuration to be written in plain javascript syntax.
By providing serialization method, this library allows to serialize/deserialize
your configuration into well formatted JavaScript code. It's even possible to
implement some code inside your configuration.
Big disclaimer: Even though it tries its best to sandbox the eval context, it's always possible that there's a security risk I missed to address. Only use this library when the configuration cannot be modified by 3rd party.
Small caveat: Even though this library is written in TypeScript and supports type definitions, it does not support serializing data into TypeScript format.
You need to decorate all the classes which occurs in your serialization.
import * as ES from "eval-serializer";
class Foo { ... };
// Expect instance of `Foo` can be created via `new Foo(param1, param2)`
ES.decorate(Foo, (obj) => [ obj.param1, obj.param2 ] );
console.log(ES.toString(new Foo("p1", "p2")));
const serialized = '...';
const obj = new Function('Foo', serialized)(Foo); // generates original object
I'd like to see IDE to suggest type informations.
Example: Serializer generates .ts
file with type reference link,
and provide .d.ts
file which contains type informations.
FAQs
Easy to write serializer
The npm package eval-serializer receives a total of 12 weekly downloads. As such, eval-serializer popularity was classified as not popular.
We found that eval-serializer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.