quenya-estree

Context enhancer for Quenya using ESTree parsers

this package is no longer on npm
Last updated 4 years ago by passcod .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install quenya-estree 
SYNC missed versions from official npm registry.

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 = require('quenya-estree')

quenyaESTree([quenya objects...], options)
.catch(err => void console.error(err))
.then(docs => {
  docs.forEach(doc => void console.log(doc))
  // ...
})

Options

  • discard (boolean, defaults to false): If true, return only objects for which an AST node was found; if false, 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-null context): 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):

  • Acorn: require('quenya-estree/acorn')(acorn options)
  • Babel: require('quenya-estree/babel')(babel-core options)
  • Babylon: require('quenya-estree/babylon')(babylon options)
  • Espree: require('quenya-estree/espree')(espree options)
  • Esprima: require('quenya-estree/esprima')(esprima options)

Current Tags

  • 1.0.2                                ...           latest (4 years ago)

3 Versions

  • 1.0.2 [deprecated]           ...           4 years ago
  • 1.0.1 [deprecated]           ...           4 years ago
  • 1.0.0 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (6)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |