Compile nearley grammars at run-time
nearley-make allows you to use nearley in Node.js, without requiring you to compile your grammar first.
Very useful for debug/development modes.
$ npm install nearley-make --save
Examples speak 1000 words.
const make =const fs =const grammar = fs // note that this is a *nearley* fileconst parser =const trees = parserresultsconst tree = trees0// logs "Hello, World!"console
# grammar.nemain -> "the usual" # output the exposed "output" variable