{"name":"@eslint-community/regexpp","version":"4.11.2","keywords":["regexp","regular","expression","parser","validator","ast","abstract","syntax","tree","ecmascript","es2015","es2016","es2017","es2018","es2019","es2020","es2021","annexB"],"author":{"name":"Toru Nagashima"},"license":"MIT","_id":"@eslint-community/regexpp@4.11.2","homepage":"https://github.com/eslint-community/regexpp#readme","bugs":{"url":"https://github.com/eslint-community/regexpp/issues"},"dist":{"shasum":"dc6925ab4ea52d3b9d6da204a3f0dd9c3852e3ad","tarball":"http://registry-npm.ywwl.com/@eslint-community/regexpp/download/@eslint-community/regexpp-4.11.2.tgz","fileCount":8,"integrity":"sha512-2WwyTYNVaMNUWPZTOJdkax9iqTdirrApgTbk+Qoq5EPX6myqZvG8QGFRgdKmkjKVG6/G/a565vpPauHk0+hpBA==","signatures":[{"sig":"MEQCIB6o1Oub+XZ/3YvX2obrZj1AHF9HFuafyiHkF0ZwVT3vAiBXyj8A780oc8MyMB8Ohw3ihjyLz5/+tnV5qWxHxPzQ0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eslint-community%2fregexpp@4.11.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":446411,"size":69863,"noattachment":false,"key":"/@eslint-community/regexpp/-/@eslint-community/regexpp-4.11.2.tgz"},"main":"index","types":"./index.d.ts","engines":{"node":"^12.0.0 || ^14.0.0 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.js"},"./package.json":"./package.json"},"gitHead":"25af7a79f1bae5782c33f32e0ba2dac54ed4b756","scripts":{"lint":"eslint . --ext .ts","test":"nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000","build":"run-s build:*","clean":"rimraf .temp index.*","debug":"mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000","watch":"_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl","prebuild":"npm run -s clean","prewatch":"npm run -s clean","build:dts":"npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts","build:tsc":"tsc --module es2015","preversion":"npm test && npm run -s build","postversion":"git push && git push --tags","update:test":"ts-node scripts/update-fixtures.ts","build:rollup":"rollup -c","update:unicode":"run-s update:unicode:*","update:unicode:ids":"ts-node scripts/update-unicode-ids.ts","update:unicode:props":"ts-node scripts/update-unicode-properties.ts","update:test262:extract":"ts-node -T scripts/extract-test262.ts"},"_npmUser":{"name":"eslint-community-bot","email":"contact+eslintcbot@eslint.org"},"repository":{"url":"git+https://github.com/eslint-community/regexpp.git","type":"git"},"_npmVersion":"10.5.2","description":"Regular expression parser for ECMAScript.","directories":{},"_nodeVersion":"20.13.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.1.1","jsdom":"^19.0.0","mocha":"^9.2.2","eslint":"^8.50.0","rimraf":"^3.0.2","rollup":"^2.79.1","ts-node":"^10.9.1","js-tokens":"^8.0.2","dts-bundle":"^0.7.3","typescript":"~5.0.2","@types/node":"^12.20.55","@types/jsdom":"^16.2.15","@types/mocha":"^9.1.1","npm-run-all2":"^6.2.2","@types/eslint":"^8.44.3","rollup-plugin-sourcemaps":"^0.6.3","@rollup/plugin-node-resolve":"^14.1.0","@eslint-community/eslint-plugin-mysticatea":"^15.5.1"},"_npmOperationalInternal":{"tmp":"tmp/regexpp_4.11.2_1729899879913_0.4133897171806675","host":"s3://npm-registry-packages"},"readme":"# @eslint-community/regexpp\n\n[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp)\n[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp)\n[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions)\n[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp)\n\nA regular expression parser for ECMAScript.\n\n## 💿 Installation\n\n```bash\n$ npm install @eslint-community/regexpp\n```\n\n- require Node@^12.0.0 || ^14.0.0 || >=16.0.0.\n\n## 📖 Usage\n\n```ts\nimport {\n    AST,\n    RegExpParser,\n    RegExpValidator,\n    RegExpVisitor,\n    parseRegExpLiteral,\n    validateRegExpLiteral,\n    visitRegExpAST\n} from \"@eslint-community/regexpp\"\n```\n\n### parseRegExpLiteral(source, options?)\n\nParse a given regular expression literal then make AST object.\n\nThis is equivalent to `new RegExpParser(options).parseLiteral(source)`.\n\n- **Parameters:**\n    - `source` (`string | RegExp`) The source code to parse.\n    - `options?` ([`RegExpParser.Options`]) The options to parse.\n- **Return:**\n    - The AST of the regular expression.\n\n### validateRegExpLiteral(source, options?)\n\nValidate a given regular expression literal.\n\nThis is equivalent to `new RegExpValidator(options).validateLiteral(source)`.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `options?` ([`RegExpValidator.Options`]) The options to validate.\n\n### visitRegExpAST(ast, handlers)\n\nVisit each node of a given AST.\n\nThis is equivalent to `new RegExpVisitor(handlers).visit(ast)`.\n\n- **Parameters:**\n    - `ast` ([`AST.Node`]) The AST to visit.\n    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.\n\n### RegExpParser\n\n#### new RegExpParser(options?)\n\n- **Parameters:**\n    - `options?` ([`RegExpParser.Options`]) The options to parse.\n\n#### parser.parseLiteral(source, start?, end?)\n\nParse a regular expression literal.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"/abc/g\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n- **Return:**\n    - The AST of the regular expression.\n\n#### parser.parsePattern(source, start?, end?, flags?)\n\nParse a regular expression pattern.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"abc\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.\n- **Return:**\n    - The AST of the regular expression pattern.\n\n#### parser.parseFlags(source, start?, end?)\n\nParse a regular expression flags.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"gim\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n- **Return:**\n    - The AST of the regular expression flags.\n\n### RegExpValidator\n\n#### new RegExpValidator(options)\n\n- **Parameters:**\n    - `options` ([`RegExpValidator.Options`]) The options to validate.\n\n#### validator.validateLiteral(source, start, end)\n\nValidate a regular expression literal.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n\n#### validator.validatePattern(source, start, end, flags)\n\nValidate a regular expression pattern.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.\n\n#### validator.validateFlags(source, start, end)\n\nValidate a regular expression flags.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n\n### RegExpVisitor\n\n#### new RegExpVisitor(handlers)\n\n- **Parameters:**\n    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.\n\n#### visitor.visit(ast)\n\nValidate a regular expression literal.\n\n- **Parameters:**\n    - `ast` ([`AST.Node`]) The AST to visit.\n\n## 📰 Changelog\n\n- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)\n\n## 🍻 Contributing\n\nWelcome contributing!\n\nPlease use GitHub's Issues/PRs.\n\n### Development Tools\n\n- `npm test` runs tests and measures coverage.\n- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`.\n- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`.\n- `npm run lint` runs ESLint.\n- `npm run update:test` updates test fixtures.\n- `npm run update:ids` updates `src/unicode/ids.ts`.\n- `npm run watch` runs tests with `--watch` option.\n\n[`AST.Node`]: src/ast.ts#L4\n[`RegExpParser.Options`]: src/parser.ts#L743\n[`RegExpValidator.Options`]: src/validator.ts#L220\n[`RegExpVisitor.Handlers`]: src/visitor.ts#L291\n","publish_time":1729899880215,"maintainers":[{"name":"eslint-community-bot","email":"contact+eslintcbot@eslint.org"},{"name":"michaeldeboey","email":"info@michaeldeboey.be"}],"_cnpm_publish_time":1729899880215,"dist-tags":{"latest":"4.12.4"}}