JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 472
  • Score
    100M100P100Q94054F
  • License MIT

Simplified options for Babylon

Package Exports

  • babylon-options

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babylon-options) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babylon-options

Simplified options for Babylon

import * as babylon from 'babylon';
import createBabylonOptions from 'babylon-options';

babylon.parse(code, createBabylonOptions({
  stage: 2,
  flow: true,
  jsx: true,
}));

Options

All Babylon options will be passed through, will some additions/modifications:

  • sourceType: Defaults to "module"
  • stage: Set plugins based on TC39 stages
  • flow: Turn on Flow support
  • jsx: Turn on JSX support
  • plugins: You can still specify plugins, other options will add to this list