Sha256: 4a1e6a3271e7b04e55bfc852113fd265f22a6dca1d021f022617881e91f5236b

Contents?: true

Size: 1.15 KB

Versions: 29

Compression:

Stored size: 1.15 KB

Contents

# RegJSGen

Generate `RegExp`s from [RegJSParser](https://github.com/jviereck/regjsparser)’s AST.

## Installation

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

## Usage

```js
var regjsgen = require('regjsgen');
// With `regjsparser`
var regjsparser = require('regjsparser');
var regex = '^a$';
var ast = regjsparser.parse(regex);
// Modify AST
// ...
// Regenerate `RegExp`
regex = regjsgen.generate(ast);
```

## See Also

 * [RegJSParser](https://github.com/jviereck/regjsparser)
 * [RegExp.js](https://github.com/jviereck/regexp.js)

## Testing

Run the command

```bash
npm test
```

To create a new reference file, execute

```bash
node test/update-fixture.js
```

from the repo top directory.

## Support

Tested in Node.js 0.8.26~0.10.30.

## Author

| [![twitter/demoneaux](http://gravatar.com/avatar/029b19dba521584d83398ada3ecf6131?s=70)](https://twitter.com/demoneaux "Follow @demoneaux on Twitter") |
|---|
| [Benjamin Tan](http://d10.github.io/) |

## Contributors

| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](http://mathiasbynens.be/) |

Version data entries

29 entries across 27 versions & 12 rubygems

Version Path
ilog-0.4.1 node_modules/regjsgen/README.md
ilog-0.4.0 node_modules/regjsgen/README.md
ilog-0.3.3 node_modules/regjsgen/README.md
optimacms-0.4.3 spec/dummy/node_modules/regjsgen/README.md
optimacms-0.4.2 spec/dummy/node_modules/regjsgen/README.md
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/regjsgen/README.md
locomotivecms-3.4.0 app/javascript/node_modules/regjsgen/README.md
cortex-0.1.3 spec/dummy/node_modules/regjsgen/README.md
dragonfly_puppeteer-0.1.0 node_modules/regjsgen/README.md
affiliator-0.2.1 node_modules/regjsgen/README.md
lanes-0.8.0 node_modules/regjsgen/README.md
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/regjsgen/README.md
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.3 node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.2 node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.1 node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.0 node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.0.alpha.3 node_modules/regjsgen/README.md
babel-schmooze-sprockets-0.1.0.alpha.2 node_modules/regjsgen/README.md
es6_tilt-0.1.2 test/dummy/node_modules/regjsgen/README.md