How to use the flow-parser/package.json.version function in flow-parser

To help you get started, we’ve selected a few flow-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github acornjs / acorn / test / bench / common.js View on Github external
'Flow'() {
    const { parse } = req('flow-parser');
    return {
      version: isWorker ? '' : require('flow-parser/package.json').version,
      parse
    };
  },
github fkling / astexplorer / website / src / parsers / js / flow.js View on Github external
'esproposal_class_static_fields',
    'esproposal_decorators',
    'esproposal_export_star_as',
    'esproposal_optional_chaining',
    'esproposal_nullish_coalescing',
    'tokens',
    'types',
  ],
};

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://flowtype.org/',
  locationProps: new Set(['range', 'loc']),

  loadParser(callback) {
    require(['flow-parser'], callback);
  },

  parse(flowParser, code, options) {
    return flowParser.parse(code, options);
  },

  getDefaultOptions() {
    return defaultOptions;
  },

  _getSettingsConfiguration() {

flow-parser

JavaScript parser written in OCaml. Produces ESTree AST

MIT
Latest version published 2 days ago

Package Health Score

93 / 100
Full package analysis