Gathering detailed insights and metrics for nearley-moo
Gathering detailed insights and metrics for nearley-moo
Gathering detailed insights and metrics for nearley-moo
Gathering detailed insights and metrics for nearley-moo
npm install nearley-moo
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
7 Commits
3 Forks
1 Watching
1 Branches
2 Contributors
Updated on 07 Dec 2019
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
150%
35
Compared to previous day
Last week
-39.1%
70
Compared to previous week
Last month
23.1%
378
Compared to previous month
Last year
759.4%
1,332
Compared to previous year
with npm
1npm install nearley-moo --save
with yarn
1yarn add nearley-moo
index.js
1const moo = require('moo') 2const nearley = require('nearley') 3const grammar = require('./grammar.js') // compiled from grammar.ne 4const tokens = require('./tokens.js') 5 6const nm = require('nearley-moo').parser(nearley, grammar) // curried 7 8let parser = nm(moo.compile(tokens)) 9 10// ignored tokens will not be passed to nearley 11// helpful for whitespace and/or comments 12parser.ignore('whitespace') // may be Array<string> or String 13 14// feed your lexer+parser combo as normal 15parser.feed('if true then moomoomoo else cows') 16 17console.log(parser.results) // just like nearley
tokens.js
1module.exports = { 2 whitespace: /[ \t]+/, 3 moo: /(moo)+/, 4 cows: /cows/, 5 boolean: [ 'true', 'false' ], 6 keyword: [ 'if', 'then', 'else'], 7}
grammar.ne
1@{% 2 3const nm = require('nearley-moo') 4const tokens = require('./tokens.js') 5 6nm(tokens) 7 8%} 9 10main -> %keyword_if expression %keyword_then expression %keyword_else expression 11 12expression -> boolean 13 | %moo 14 | %cows 15 16boolean -> %boolean_true {% d => true %} 17 | %boolean_false {% d => false %}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/6 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
license 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 2024-11-18
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