JSPM

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

Generate `RegExp`s from RegJSParser’s AST

Package Exports

  • regjsgen

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 (regjsgen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RegJSGen

Generate RegExps from RegJSParser’s AST.

Installation

npm install --save regjsgen

Usage

var regjsgen = require('regjsgen');
// With `regjsparser`
var regjsparser = require('regjsparser');
var regex = '^a$';
var ast = regjsparser.parse(regex);
// Modify AST
// ...
// Regenerate `RegExp`
regex = regjsgen.generate(ast);

See Also

Testing

Run the command

npm test

To create a new reference file, execute

node test/update-fixture.js

from the repo top directory.

Support

Tested in Node.js 0.8.26~0.10.30.

Author

twitter/demoneaux
Benjamin Tan

Contributors

twitter/mathias
Mathias Bynens