
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
JSON templates using ES6+ object notation.
Like JSON, but really JS.
babelon uses vm, Function, and/or eval, so only use it where you trust the input.
npm i --save babelon
Let's say you want to mockup an JSON response, you can use babelon to write a template:
> example.babelon
{
user: {
id: user_id, /* variables */
name: `${faker.name.firstName()} ${faker.name.lastName()}` // templates
},
posts: posts.map((post) => ({ // iterators
id: post.id
})),
addOne: (v) => { // functions
let a = 1;
return v+a;
},
...misc, // object spread properties
is_active // property shorthand
}
> index.js
import babelon from 'babelon';
import faker from 'faker';
let tmpl = babelon.compile('example.babelon');
let obj = tmpl({faker, user_id: 1, posts: [{id: 1}], misc: {}, is_active: true});
// obj:
// { user: { id: 1, name: 'First Last' },
// posts: [ { id: 1 } ],
// addOne: [Function],
// is_active: true }
babelon.compileFile(file_path): returns callable template
babelon.evalFile(file_path, locals = null): returns rendered template using locals
babelon.compile(code_str): returns callable template
babelon.eval(code_str, locals = null): returns rendered template using locals
FAQs
JSON templates using ES6+ object notation
The npm package babelon receives a total of 311 weekly downloads. As such, babelon popularity was classified as not popular.
We found that babelon 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.