{"name":"@eslint-community/regexpp","version":"4.12.1","description":"Regular expression parser for ECMAScript.","keywords":["regexp","regular","expression","parser","validator","ast","abstract","syntax","tree","ecmascript","es2015","es2016","es2017","es2018","es2019","es2020","es2021","annexB"],"homepage":"https://github.com/eslint-community/regexpp#readme","bugs":{"url":"https://github.com/eslint-community/regexpp/issues"},"repository":{"type":"git","url":"git+https://github.com/eslint-community/regexpp.git"},"license":"MIT","author":{"name":"Toru Nagashima"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.js"},"./package.json":"./package.json"},"main":"index","scripts":{"prebuild":"npm run -s clean","build":"run-s build:*","build:tsc":"tsc --module es2015","build:rollup":"rollup -c","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","clean":"rimraf .temp index.*","lint":"eslint . --ext .ts","test":"nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000","debug":"mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000","update:test":"ts-node scripts/update-fixtures.ts","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","preversion":"npm test && npm run -s build","postversion":"git push && git push --tags","prewatch":"npm run -s clean","watch":"_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"},"dependencies":{},"devDependencies":{"@eslint-community/eslint-plugin-mysticatea":"^15.5.1","@rollup/plugin-node-resolve":"^14.1.0","@types/eslint":"^8.44.3","@types/jsdom":"^16.2.15","@types/mocha":"^9.1.1","@types/node":"^12.20.55","dts-bundle":"^0.7.3","eslint":"^8.50.0","js-tokens":"^8.0.2","jsdom":"^19.0.0","mocha":"^9.2.2","npm-run-all2":"^6.2.2","nyc":"^14.1.1","rimraf":"^3.0.2","rollup":"^2.79.1","rollup-plugin-sourcemaps":"^0.6.3","ts-node":"^10.9.1","typescript":"~5.0.2"},"engines":{"node":"^12.0.0 || ^14.0.0 || >=16.0.0"},"_id":"@eslint-community/regexpp@4.12.1","gitHead":"c4852c9efb299a8579651e3ac3c7d9a71b89f8c6","types":"./index.d.ts","_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==","shasum":"cfc6cffe39df390a3841cde2abccf92eaa7ae0e0","tarball":"http://registry-npm.ywwl.com/@eslint-community/regexpp/download/@eslint-community/regexpp-4.12.1.tgz","fileCount":8,"unpackedSize":472794,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eslint-community%2fregexpp@4.12.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1zUfFzEhmWmb/4YBjB2Rvc0LJwJzsVG7PCR/Q6qj79wIhAKRZJzYUrMYXb8/WYZ3o62+YAEhpbAOn5oB3HZ8XC1O2"}],"size":73232,"noattachment":false,"key":"/@eslint-community/regexpp/-/@eslint-community/regexpp-4.12.1.tgz"},"_npmUser":{"name":"eslint-community-bot","email":"contact+eslintcbot@eslint.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexpp_4.12.1_1730075914041_0.3150895126156603"},"_hasShrinkwrap":false,"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":1730075914193,"maintainers":[{"name":"eslint-community-bot","email":"contact+eslintcbot@eslint.org"},{"name":"michaeldeboey","email":"info@michaeldeboey.be"}],"_cnpm_publish_time":1730075914193,"dist-tags":{"latest":"4.12.4"}}