Gathering detailed insights and metrics for babelon
Gathering detailed insights and metrics for babelon
npm install babelon
Typescript
Module System
Node Version
NPM Version
62.3
Supply Chain
79.1
Quality
71.7
Maintenance
25
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
177,348
Last Day
1
Last Week
55
Last Month
596
Last Year
8,738
1 Stars
10 Commits
3 Watching
1 Branches
2 Contributors
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
-96%
1
Compared to previous day
Last week
-72.4%
55
Compared to previous week
Last month
-25.4%
596
Compared to previous month
Last year
48.2%
8,738
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
project is not fuzzed
Details
Reason
security policy file not detected
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-01-27
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