Quenya ESTree Enhancer
Uses an ESTree-compatible parser to enhance Quenya doc objects with the JS AST node their context points to.
npm install quenya-estree
Usage
const quenyaESTree =
Options
-
discard
(boolean, defaults tofalse
): Iftrue
, return only objects for which an AST node was found; iffalse
, pass-through all others too. -
parser
(function, required): Will be passed a path, should return a Promise that resolves to the AST or an error. -
filter
(function, defaults to checking the extension matches.js
and the doc has a non-nullcontext
): Will be passed a path, should return truthy if the described file should be parsed and falsy otherwise.
Parsers
There are five already-Promisified parsers available (but of course you may plug in your own):