Sha256: 50df73b58dd287ed20ed772634c3041ff1c95e353bad29ce59a464dd3887eea4

Contents?: true

Size: 917 Bytes

Versions: 11

Compression:

Stored size: 917 Bytes

Contents

# regjsgen [![Build status](https://travis-ci.org/bnjmnt4n/regjsgen.svg?branch=master)](https://travis-ci.org/bnjmnt4n/regjsgen) [![Code coverage status](https://codecov.io/gh/bnjmnt4n/regjsgen/branch/master/graph/badge.svg)](https://codecov.io/gh/bnjmnt4n/regjsgen)

Generate regular expressions from [regjsparser](https://github.com/jviereck/regjsparser)’s AST.

## Installation

```bash
npm install --save regjsgen
```

## API

### `regjsgen.generate(ast)`

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

```js
var regjsparser = require('regjsparser');
var regjsgen = require('regjsgen');

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

// Modify AST
// …

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

## Support

Tested in Node.js 0.10, 0.12, 4, 6 and 8.

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
condenser-0.0.8 lib/condenser/processors/node_modules/regjsgen/README.md
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/regjsgen/README.md
jester-data-8.0.0 node_modules/regjsgen/README.md
ezii-os-5.2.1 node_modules/regjsgen/README.md
ezii-os-2.0.1 node_modules/regjsgen/README.md
ezii-os-1.1.0 node_modules/regjsgen/README.md
ezii-os-1.0.0 node_modules/regjsgen/README.md
condenser-0.0.7 lib/condenser/processors/node_modules/regjsgen/README.md
ezii-os-0.0.0.1.0 node_modules/regjsgen/README.md
ezii-os-0.0.0.0.1 node_modules/regjsgen/README.md
condenser-0.0.5 lib/condenser/processors/node_modules/regjsgen/README.md