babel-file
Easily create a Babel File object
Last updated 6 years ago by thejameskyle .
MIT · Original npm · Tarball · package.json
$ npm install babel-file 
SYNC missed versions from official npm registry.

babel-file

Easily create a Babel File object

  • Constructs File object
  • Adds/parses code with nice errors
import createFile from 'babel-file';
import createBabylonOptions from 'babylon-options';

const file = createFile(code, {
  filename: 'filename.js',
  parserOpts: createBabylonOptions({
    stage: 2,
  }),
});

file.code;
file.ast;
file.path;

Accepts all the same options as the normal Babel File object.

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

4 Versions

  • 3.0.0                                ...           6 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE