
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
eval-serializer
Advanced tools
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
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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.