Installations
npm install babelon
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
6.9.2
NPM Version
3.10.9
Score
62.3
Supply Chain
79.1
Quality
71.7
Maintenance
25
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
foysavas
Download Statistics
Total Downloads
177,348
Last Day
1
Last Week
55
Last Month
596
Last Year
8,738
GitHub Statistics
1 Stars
10 Commits
3 Watching
1 Branches
2 Contributors
Bundle Size
547.01 kB
Minified
147.51 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
177,348
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
8
babelon
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.
Install
npm i --save babelon
Example
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 }
Methods
-
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
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
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3.2
/10
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