{"name":"eslint-visitor-keys","version":"5.0.0","keywords":["eslint"],"author":{"url":"https://github.com/mysticatea","name":"Toru Nagashima"},"license":"Apache-2.0","_id":"eslint-visitor-keys@5.0.0","maintainers":[{"name":"openjsfoundation","email":"npm@openjsf.org"},{"name":"eslintbot","email":"contact@eslint.org"}],"homepage":"https://github.com/eslint/js/blob/main/packages/eslint-visitor-keys/README.md","bugs":{"url":"https://github.com/eslint/js/issues"},"dist":{"shasum":"b9aa1a74aa48c44b3ae46c1597ce7171246a94a9","tarball":"http://registry-npm.ywwl.com/eslint-visitor-keys/download/eslint-visitor-keys-5.0.0.tgz","fileCount":9,"integrity":"sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==","signatures":[{"sig":"MEUCIHCacE780jDwG2acz4sXH5YEABDAtUiH99swmr4fD4/RAiEAxeeY6JxpkmrQsqwh2Y4vOwwytvM3mm5KSgvZpVK2Syk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/eslint-visitor-keys@5.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35864,"size":8843,"noattachment":false,"key":"/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz"},"main":"dist/eslint-visitor-keys.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":[{"import":"./lib/index.js","require":"./dist/eslint-visitor-keys.cjs"},"./dist/eslint-visitor-keys.cjs"],"./package.json":"./package.json"},"funding":"https://opencollective.com/eslint","gitHead":"3efd40382d3d87505c8165bab121ebe0362924c0","scripts":{"test":"mocha \"tests/**/*.test.cjs\" && c8 mocha \"tests/**/*.test.js\" && npm run test:types","build":"npm run build:cjs && npm run build:types","build:cjs":"rollup -c","test:types":"tsd","build:debug":"npm run build:cjs -- -m && npm run build:types","build:types":"tsc -v && tsc","test:open-coverage":"c8 report --reporter lcov && opener coverage/lcov-report/index.html"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3ac3bb05-c2c9-4018-a497-7a0787d66fe2"}},"repository":{"url":"git+https://github.com/eslint/js.git","type":"git","directory":"packages/eslint-visitor-keys"},"_npmVersion":"11.6.2","description":"Constants and utilities about visitor keys to traverse AST.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"tsd":"^0.33.0","opener":"^1.5.2","rollup":"^4.50.2","typescript":"^5.9.2","rollup-plugin-dts":"^6.2.3"},"_npmOperationalInternal":{"tmp":"tmp/eslint-visitor-keys_5.0.0_1762792202358_0.29412120038633316","host":"s3://npm-registry-packages-npm-production"},"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":1762792202580,"_cnpm_publish_time":1762792202580,"dist-tags":{"latest":"5.0.1"}}