# regjsgen

> Generate regular expressions from regjsparser’s AST.

Latest version **0.8.0** (published 2023-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install regjsgen
pnpm add regjsgen
yarn add regjsgen
bun add regjsgen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2023-06-06 |
| First published | 2014-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Benjamin Tan |
| Maintainers | bnjmnt4n |
| Keywords | ast, generate, regex, regexp, regular expressions |

## Links

- npm: https://www.npmjs.com/package/regjsgen
- Repository: https://github.com/bnjmnt4n/regjsgen
- Issues: https://github.com/bnjmnt4n/regjsgen/issues
- npm.io page: https://npm.io/package/regjsgen

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.8.0 (latest) — 2023-06-06
- 0.7.1 — 2022-01-17
- 0.7.0 — 2021-12-24
- 0.6.0 — 2021-10-01
- 0.5.2 — 2020-05-24
- 0.5.1 — 2019-10-20
- 0.5.0 — 2018-10-27
- 0.4.0 — 2018-01-17
- 0.3.0 — 2016-06-01
- 0.2.0 — 2014-09-02
- 0.1.2 — 2014-08-24
- 0.1.1 — 2014-07-09
- 0.1.0 — 2014-07-01

## README

# regjsgen [![Build status][ci-img]][ci] [![Code coverage status][codecov-img]][codecov]

Generate regular expressions from [regjsparser][regjsparser]’s AST.

## Installation

```sh
npm i regjsgen
```

## API

### `regjsgen.generate(ast)`

This function accepts an abstract syntax tree representing a regular expression (see [regjsparser][regjsparser]), and returns the generated regular expression string.

```js
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.<br>
Compatible with regjsparser v0.10.0’s AST.


[ci]: https://github.com/bnjmnt4n/regjsgen/actions
[ci-img]: https://github.com/bnjmnt4n/regjsgen/workflows/Node.js%20CI/badge.svg
[codecov]: https://codecov.io/gh/bnjmnt4n/regjsgen
[codecov-img]: https://codecov.io/gh/bnjmnt4n/regjsgen/branch/main/graph/badge.svg
[regjsparser]: https://github.com/jviereck/regjsparser

---
_Source: https://npm.io/package/regjsgen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
