regjsgen
Generate regular expressions from regjsparser’s AST.
Last updated 2 years ago by bnjmnt4n .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install regjsgen 
SYNC missed versions from official npm registry.

regjsgen Build status Code coverage status

Generate regular expressions from regjsparser’s AST.

Installation

npm i regjsgen

API

regjsgen.generate(ast)

This function accepts an abstract syntax tree representing a regular expression (see regjsparser), and returns the generated regular expression string.

const regjsparser = require('regjsparser');
const regjsgen = require('regjsgen');

// Generate an AST with `regjsparser`.
let ast = regjsparser.parse(regex);

// Modify AST
// …

// Generate `RegExp` string with `regjsgen`.
let regex = regjsgen.generate(ast);

Support

Tested on Node.js 16 and 18.
Compatible with regjsparser v0.10.0’s AST.

Current Tags

  • 0.8.0                                ...           latest (2 years ago)

13 Versions

  • 0.8.0                                ...           2 years ago
  • 0.7.1                                ...           3 years ago
  • 0.7.0                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           6 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (2)

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