Buckets:
1.39 GB
20,046 files
Updated 15 days ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| bin | 1 items | ||
| LICENSE.BSD | 1.3 kB xet | df7587eb | |
| README.md | 788 Bytes xet | e8b90422 | |
| package.json | 1.18 kB xet | dc1dd5b1 | |
| parser.d.ts | 3.82 kB xet | d2480fff | |
| parser.js | 64.7 kB xet | 2ffa4ad4 |
RegJSParser
Parsing the JavaScript's RegExp in JavaScript.
Installation
npm install regjsparser
Usage
var parse = require('regjsparser').parse;
var parseTree = parse('^a'); // /^a/
console.log(parseTree);
// Toggle on/off additional features:
var parseTree = parse('^a', '', {
// SEE: https://github.com/jviereck/regjsparser/pull/78
unicodePropertyEscape: true,
// SEE: https://github.com/jviereck/regjsparser/pull/83
namedGroups: true,
// SEE: https://github.com/jviereck/regjsparser/pull/89
lookbehind: true
});
console.log(parseTree);
Testing
To run the tests, run the following command:
npm test
To create a new reference file, execute…
node test/update-fixtures.js
…from the repo top directory.
- Total size
- 1.39 GB
- Files
- 20,046
- Last updated
- May 9
- Pre-warmed CDN
- US EU US EU