{"name":"eslint-visitor-keys","version":"5.0.1","description":"Constants and utilities about visitor keys to traverse AST.","type":"module","main":"dist/eslint-visitor-keys.cjs","types":"./dist/index.d.ts","exports":{".":[{"import":"./lib/index.js","require":"./dist/eslint-visitor-keys.cjs"},"./dist/eslint-visitor-keys.cjs"],"./package.json":"./package.json"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"devDependencies":{"rollup-plugin-dts":"^6.2.3","tsd":"^0.33.0"},"scripts":{"build":"npm run build:cjs && npm run build:types","build:cjs":"rollup -c","build:debug":"npm run build:cjs -- -m && npm run build:types","build:types":"tsc -v && tsc","test":"mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\" && npm run test:types","test:coverage":"c8 npm test","test:types":"tsd"},"repository":{"type":"git","url":"git+https://github.com/eslint/js.git","directory":"packages/eslint-visitor-keys"},"funding":"https://opencollective.com/eslint","keywords":["eslint"],"author":{"name":"Toru Nagashima","url":"https://github.com/mysticatea"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/js/issues"},"homepage":"https://github.com/eslint/js/blob/main/packages/eslint-visitor-keys/README.md","sideEffects":false,"gitHead":"a52a694e064952bd55cf6050049062464a0c1304","_id":"eslint-visitor-keys@5.0.1","_nodeVersion":"24.13.0","_npmVersion":"11.10.1","dist":{"integrity":"sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==","shasum":"9e3c9489697824d2d4ce3a8ad12628f91e9f59be","tarball":"http://registry-npm.ywwl.com/eslint-visitor-keys/download/eslint-visitor-keys-5.0.1.tgz","fileCount":9,"unpackedSize":31942,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/eslint-visitor-keys@5.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/MkKkZDt1didyEscIrEBvxfB0xxm5vTuyW72wOzo9jQIgQssOJ9A7JCQAXo5hEuhZ3alENSqYfSzy/3CfvdWQmHg="}],"size":8751,"noattachment":false,"key":"/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3ac3bb05-c2c9-4018-a497-7a0787d66fe2"}},"directories":{},"maintainers":[{"name":"openjsfoundation","email":"npm@openjsf.org"},{"name":"eslintbot","email":"contact@eslint.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-visitor-keys_5.0.1_1771598447683_0.6409981393834834"},"_hasShrinkwrap":false,"readme":"# eslint-visitor-keys\n\n[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys)\n[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys)\n[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/eslint/js/actions)\n\nConstants and utilities about visitor keys to traverse AST.\n\n## 💿 Installation\n\nUse [npm] to install.\n\n```bash\n$ npm install eslint-visitor-keys\n```\n\n### Requirements\n\n- [Node.js] `^20.19.0`, `^22.13.0`, or `>=24`\n\n## 📖 Usage\n\nTo use in an ESM file:\n\n```js\nimport * as evk from \"eslint-visitor-keys\";\n```\n\nTo use in a CommonJS file:\n\n```js\nconst evk = require(\"eslint-visitor-keys\");\n```\n\n### evk.KEYS\n\n> type: `{ [type: string]: string[] | undefined }`\n\nVisitor keys. This keys are frozen.\n\nThis is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes.\n\nFor example:\n\n```\nconsole.log(evk.KEYS.AssignmentExpression) // → [\"left\", \"right\"]\n```\n\n### evk.getKeys(node)\n\n> type: `(node: object) => string[]`\n\nGet the visitor keys of a given AST node.\n\nThis is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`.\n\nThis will be used to traverse unknown nodes.\n\nFor example:\n\n```js\nconst node = {\n\ttype: \"AssignmentExpression\",\n\tleft: { type: \"Identifier\", name: \"foo\" },\n\tright: { type: \"Literal\", value: 0 },\n};\nconsole.log(evk.getKeys(node)); // → [\"type\", \"left\", \"right\"]\n```\n\n### evk.unionWith(additionalKeys)\n\n> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }`\n\nMake the union set with `evk.KEYS` and the given keys.\n\n- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that.\n- It removes duplicated keys as keeping the first one.\n\nFor example:\n\n```js\nconsole.log(\n\tevk.unionWith({\n\t\tMethodDefinition: [\"decorators\"],\n\t}),\n); // → { ..., MethodDefinition: [\"decorators\", \"key\", \"value\"], ... }\n```\n\n## 📰 Change log\n\nSee [GitHub releases](https://github.com/eslint/js/releases).\n\n## 🍻 Contributing\n\nWelcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/).\n\n### Development commands\n\n- `npm test` runs tests and measures code coverage.\n- `npm run lint` checks source codes with ESLint.\n- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser.\n\n[npm]: https://www.npmjs.com/\n[Node.js]: https://nodejs.org/\n[ESTree]: https://github.com/estree/estree\n\n<!-- NOTE: This section is autogenerated. Do not manually edit.-->\n<!--sponsorsstart-->\n\n## Sponsors\n\nThe following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)\nto get your logo on our READMEs and [website](https://eslint.org/sponsors).\n\n<h3>Platinum Sponsors</h3>\n<p><a href=\"https://automattic.com\"><img src=\"https://images.opencollective.com/automattic/d0ef3e1/logo.png\" alt=\"Automattic\" height=\"128\"></a></p><h3>Gold Sponsors</h3>\n<p><a href=\"https://qlty.sh/\"><img src=\"https://images.opencollective.com/qltysh/33d157d/logo.png\" alt=\"Qlty Software\" height=\"96\"></a> <a href=\"https://shopify.engineering/\"><img src=\"https://avatars.githubusercontent.com/u/8085\" alt=\"Shopify\" height=\"96\"></a></p><h3>Silver Sponsors</h3>\n<p><a href=\"https://vite.dev/\"><img src=\"https://images.opencollective.com/vite/d472863/logo.png\" alt=\"Vite\" height=\"64\"></a> <a href=\"https://liftoff.io/\"><img src=\"https://images.opencollective.com/liftoff/2d6c3b6/logo.png\" alt=\"Liftoff\" height=\"64\"></a> <a href=\"https://stackblitz.com\"><img src=\"https://avatars.githubusercontent.com/u/28635252\" alt=\"StackBlitz\" height=\"64\"></a></p><h3>Bronze Sponsors</h3>\n<p><a href=\"https://cybozu.co.jp/\"><img src=\"https://images.opencollective.com/cybozu/933e46d/logo.png\" alt=\"Cybozu\" height=\"32\"></a> <a href=\"https://opensource.sap.com\"><img src=\"https://avatars.githubusercontent.com/u/2531208\" alt=\"SAP\" height=\"32\"></a> <a href=\"https://www.crawljobs.com/\"><img src=\"https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png\" alt=\"CrawlJobs\" height=\"32\"></a> <a href=\"https://depot.dev\"><img src=\"https://images.opencollective.com/depot/39125a1/logo.png\" alt=\"Depot\" height=\"32\"></a> <a href=\"https://www.n-ix.com/\"><img src=\"https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png\" alt=\"N-iX Ltd\" height=\"32\"></a> <a href=\"https://icons8.com/\"><img src=\"https://images.opencollective.com/icons8/7fa1641/logo.png\" alt=\"Icons8\" height=\"32\"></a> <a href=\"https://discord.com\"><img src=\"https://images.opencollective.com/discordapp/f9645d9/logo.png\" alt=\"Discord\" height=\"32\"></a> <a href=\"https://www.gitbook.com\"><img src=\"https://avatars.githubusercontent.com/u/7111340\" alt=\"GitBook\" height=\"32\"></a> <a href=\"https://herocoders.com\"><img src=\"https://avatars.githubusercontent.com/u/37549774\" alt=\"HeroCoders\" height=\"32\"></a> <a href=\"https://www.lambdatest.com\"><img src=\"https://avatars.githubusercontent.com/u/171592363\" alt=\"TestMu AI Open Source Office (Formerly LambdaTest)\" height=\"32\"></a></p>\n<h3>Technology Sponsors</h3>\nTechnology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.\n<p><a href=\"https://netlify.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg\" alt=\"Netlify\" height=\"32\"></a> <a href=\"https://algolia.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg\" alt=\"Algolia\" height=\"32\"></a> <a href=\"https://1password.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg\" alt=\"1Password\" height=\"32\"></a></p>\n<!--sponsorsend-->\n","publish_time":1771598447824,"_cnpm_publish_time":1771598447824,"dist-tags":{"latest":"5.0.1"}}