Gathering detailed insights and metrics for babelon7
Gathering detailed insights and metrics for babelon7
npm install babelon7
Typescript
Module System
Node Version
NPM Version
57.1
Supply Chain
81.9
Quality
74.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
693
Last Day
1
Last Week
2
Last Month
13
Last Year
76
1 Stars
10 Commits
3 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
babelon7@2.0.0
Unpacked Size
6.27 kB
Size
2.46 kB
File Count
7
NPM Version
6.7.0
Node Version
10.13.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-50%
2
Compared to previous week
Last month
333.3%
13
Compared to previous month
Last year
-25.5%
76
Compared to previous year
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