Gathering detailed insights and metrics for babelon
Gathering detailed insights and metrics for babelon
Gathering detailed insights and metrics for babelon
Gathering detailed insights and metrics for babelon
JSON templates using ES6+ object notation. Like JSON, but really JS.
npm install babelon
Typescript
Module System
Node Version
NPM Version
61.5
Supply Chain
79.1
Quality
71.7
Maintenance
25
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
181,417
Last Day
2
Last Week
172
Last Month
813
Last Year
10,869
MIT License
1 Stars
10 Commits
2 Watchers
1 Branches
2 Contributors
Updated on Jan 25, 2024
Minified
Minified + Gzipped
Latest Version
1.0.5
Package Id
babelon@1.0.5
Unpacked Size
6.61 kB
Size
2.76 kB
File Count
8
NPM Version
3.10.9
Node Version
6.9.2
Cumulative downloads
Total Downloads
Last Day
-50%
2
Compared to previous day
Last Week
-23.9%
172
Compared to previous week
Last Month
-34.7%
813
Compared to previous month
Last Year
99%
10,869
Compared to previous year
8
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
1{ 2 user: { 3 id: user_id, /* variables */ 4 name: `${faker.name.firstName()} ${faker.name.lastName()}` // templates 5 }, 6 posts: posts.map((post) => ({ // iterators 7 id: post.id 8 })), 9 addOne: (v) => { // functions 10 let a = 1; 11 return v+a; 12 }, 13 ...misc, // object spread properties 14 is_active // property shorthand 15}
> index.js
1import babelon from 'babelon'; 2import faker from 'faker'; 3 4let tmpl = babelon.compile('example.babelon'); 5 6let obj = tmpl({faker, user_id: 1, posts: [{id: 1}], misc: {}, is_active: true}); 7 8// obj: 9// { user: { id: 1, name: 'First Last' }, 10// posts: [ { id: 1 } ], 11// addOne: [Function], 12// 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
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/9 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More