regjsgen
Generating JavaScript RegExps in JavaScript
Last updated 10 years ago by d10 .
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 2
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (2)

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