regjsgen
Generate regular expressions from regjsparser’s AST.
Last updated 3 years ago by bnjmnt4n .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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 in Node.js 10, 12, 14, and 16.
Compatible with regjsparser v0.7.0’s AST.

Current Tags

  • 0.7.1                                ...           latest (3 years ago)

12 Versions

  • 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
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)

Copyright 2013 - present © cnpmjs.org | Home |