How to use the meriyah/package.json.version function in meriyah

To help you get started, we’ve selected a few meriyah 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 fkling / astexplorer / website / src / parsers / js / meriyah.js View on Github external
import React from 'react';
import defaultParserInterface from './utils/defaultESTreeParserInterface';
import pkg from 'meriyah/package.json';

const ID = pkg.name;

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage,

  loadParser(callback) {
    require(['meriyah'], callback);
  },

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

  nodeToRange(node) {
    if (typeof node.start === 'number') {
      return [node.start, node.end];
    }
  },

meriyah

A 100% compliant, self-hosted javascript parser with high focus on both performance and stability

ISC
Latest version published 24 days ago

Package Health Score

86 / 100
Full package analysis