This file is indexed.

/usr/share/doc/node-regjsgen/README.md is in node-regjsgen 0.4.0+ds-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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.