{"_id":"@cjser/es-joy__jsdoccomment__v0_96_0","name":"@cjser/es-joy__jsdoccomment__v0_96_0","dist-tags":{"latest":"0.96.0-cjser.2"},"versions":{"0.96.0-cjser.2":{"name":"@cjser/es-joy__jsdoccomment__v0_96_0","version":"0.96.0-cjser.2","author":{"name":"Brett Zamir","email":"brettz9@yahoo.com"},"contributors":[],"description":"Maintained replacement for ESLint's deprecated SourceCode#getJSDocComment along with other jsdoc utilities","license":"MIT","keywords":["ast","comment","estree","jsdoc","parser","eslint","sourcecode"],"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist-cjser/index.cjs","default":"./src/index.js"}},"browserslist":["defaults, not op_mini all"],"typedocOptions":{"dmtLinksService":{"GitHub":"https://github.com/es-joy/jsdoccomment","NPM":"https://www.npmjs.com/package/@es-joy/jsdoccomment"}},"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"bugs":{"url":"https://github.com/es-joy/jsdoccomment/issues"},"homepage":"https://github.com/es-joy/jsdoccomment","engines":{"node":"^22.22.2 || >=24.15.0"},"dependencies":{"@types/estree":"^1.0.9","@typescript-eslint/types":"^8.67.0","comment-parser":"1.4.8","esquery":"^1.7.0","@cjser/jsdoc-type-pratt-parser":"9.2.1-cjser.2"},"devDependencies":{"@arethetypeswrong/cli":"^0.18.5","@brettz9/node-static":"^0.1.1","@types/esquery":"^1.5.4","@types/estraverse":"^5.1.7","@typescript-eslint/visitor-keys":"^8.67.0","@typhonjs-build-test/esm-d-ts":"0.4.0","@typhonjs-typedoc/typedoc-pkg":"^0.4.2","@vitest/coverage-v8":"^4.1.11","@vitest/ui":"^4.1.11","@webcoder49/code-input":"^2.8.3","eslint":"^10.9.0","eslint-config-ash-nazg":"42.6.0","eslint-plugin-jsdoc":"^64.2.1","espree":"^11.2.0","estraverse":"^5.3.0","prismjs":"^1.30.0","typedoc":"^0.28.20","typescript":"^5.9.3","typescript-eslint":"^8.67.0","vitest":"^4.1.11"},"scripts":{"start":"static -p 8070","attw":"attw --pack . --profile esm-only","copy":"cp -R node_modules/prismjs/ demo/vendor/prismjs/ && cp -R node_modules/@webcoder49/code-input/ demo/vendor/@webcoder49/code-input/ && cp node_modules/esquery/dist/esquery.esm.js demo/vendor/esquery/dist/esquery.esm.js && cp -R node_modules/jsdoc-type-pratt-parser/dist demo/vendor/jsdoc-type-pratt-parser && cp -R node_modules/comment-parser/es6 demo/vendor/comment-parser","build":"npm run copy && npm run types","docs":"typedoc-pkg --api-link es","eslint":"eslint .","lint":"npm run eslint --","open":"open ./coverage/index.html","test":"npm run lint && npm run build && npm run test-cov","test-ui":"vitest --ui --coverage","test-cov":"vitest --coverage","tsc":"tsc","types":"esm-d-ts gen ./src/index.js --output ./dist/index.d.ts"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"0.96.0","cjserVersion":2,"original":{"name":"@es-joy/jsdoccomment","version":"0.96.0","exports":{".":{"types":"./dist/index.d.ts","default":"./src/index.js"}},"repository":{"type":"git","url":"git+https://github.com/es-joy/jsdoccomment.git"},"dependencies":{"@types/estree":"^1.0.9","@typescript-eslint/types":"^8.67.0","comment-parser":"1.4.8","esquery":"^1.7.0","jsdoc-type-pratt-parser":"~9.2.0"},"files":["/dist","/src","CHANGES.md","LICENSE-MIT.txt"],"scripts":{"start":"static -p 8070","attw":"attw --pack . --profile esm-only","copy":"cp -R node_modules/prismjs/ demo/vendor/prismjs/ && cp -R node_modules/@webcoder49/code-input/ demo/vendor/@webcoder49/code-input/ && cp node_modules/esquery/dist/esquery.esm.js demo/vendor/esquery/dist/esquery.esm.js && cp -R node_modules/jsdoc-type-pratt-parser/dist demo/vendor/jsdoc-type-pratt-parser && cp -R node_modules/comment-parser/es6 demo/vendor/comment-parser","build":"npm run copy && npm run types","docs":"typedoc-pkg --api-link es","eslint":"eslint .","lint":"npm run eslint --","open":"open ./coverage/index.html","test":"npm run lint && npm run build && npm run test-cov","test-ui":"vitest --ui --coverage","test-cov":"vitest --coverage","tsc":"tsc","types":"esm-d-ts gen ./src/index.js --output ./dist/index.d.ts"}}},"_id":"@cjser/es-joy__jsdoccomment__v0_96_0@0.96.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-nekBp2FYWsro1wd1jyHOMG6YRzcOAMo7ZirUpH46cHGcUowYtgoL0zTtQCh+YVZHs6IykrrByL+Xx3YjqUhnnA==","shasum":"11bb746a5a34934dc5d9b6a68b1efeed8c96fcaa","tarball":"https://registry.npmjs.org/@cjser/es-joy__jsdoccomment__v0_96_0/-/es-joy__jsdoccomment__v0_96_0-0.96.0-cjser.2.tgz","fileCount":15,"unpackedSize":139523,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBHDRaazgnV1eoA36IphzbKIYT3aWfVkyaqIZcClLzDJAiEA0RZCq0J2xVj5rJV3Xpthk9qz1zmqftIIndqEyizxFJc="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/es-joy__jsdoccomment__v0_96_0_0.96.0-cjser.2_1788631598827_0.5150731686973089"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-05T18:06:38.655Z","0.96.0-cjser.2":"2026-09-05T18:06:38.980Z","modified":"2026-09-05T18:06:39.246Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Maintained replacement for ESLint's deprecated SourceCode#getJSDocComment along with other jsdoc utilities","homepage":"https://github.com/es-joy/jsdoccomment","keywords":["ast","comment","estree","jsdoc","parser","eslint","sourcecode"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"contributors":[],"author":{"name":"Brett Zamir","email":"brettz9@yahoo.com"},"bugs":{"url":"https://github.com/es-joy/jsdoccomment/issues"},"license":"MIT","readme":"# @es-joy/jsdoccomment\n\n[![NPM](https://img.shields.io/npm/v/@es-joy/jsdoccomment.svg?label=npm)](https://www.npmjs.com/package/@es-joy/jsdoccomment)\n[![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat)](https://github.com/es-joy/jsdoccomment/blob/main/LICENSE-MIT.txt)\n[![Build Status](https://github.com/es-joy/jsdoccomment/workflows/CI/CD/badge.svg)](#)\n[![API Docs](https://img.shields.io/badge/API%20Documentation-476ff0)](https://es-joy.github.io/jsdoccomment/docs/)\n\nSee the **[Demo](https://es-joy.github.io/jsdoccomment/demo/)** and\n**[Docs](https://es-joy.github.io/jsdoccomment/docs/)**.\n\nThis project aims to preserve and expand upon the\n`SourceCode#getJSDocComment` functionality of the deprecated ESLint method.\n\nIt also exports a number of functions currently for working with JSDoc:\n\n## API\n\n### `parseComment`\n\nFor parsing `comment-parser` in a JSDoc-specific manner.\nMight wish to have tags with or without tags, etc. derived from a split off\nJSON file.\n\n### `commentParserToESTree`\n\nConverts [comment-parser](https://github.com/syavorsky/comment-parser)\nAST to ESTree/ESLint/Babel friendly AST. See the \"ESLint AST...\" section below.\n\n### `estreeToString`\n\nStringifies. In addition to the node argument, it accepts an optional second\noptions object with a single `preferRawType` key. If you don't need to modify\nJSDoc type AST, you might wish to set this to `true` to get the benefits of\npreserving the raw form, but for AST-based stringification of JSDoc types,\nkeep it `false` (the default).\n\n### `jsdocVisitorKeys`\n\nThe [VisitorKeys](https://github.com/eslint/eslint-visitor-keys)\nfor `JsdocBlock`, `JsdocDescriptionLine`, and `JsdocTag`. More likely to be\nsubject to change or dropped in favor of another type parser.\n\n### `jsdocTypeVisitorKeys`\n\nJust a re-export of [VisitorKeys](https://github.com/eslint/eslint-visitor-keys)\nfrom [`jsdoc-type-pratt-parser`](https://github.com/simonseyock/jsdoc-type-pratt-parser/).\n\n### `getDefaultTagStructureForMode`\n\nProvides info on JSDoc tags:\n\n- `nameContents` ('namepath-referencing'|'namepath-defining'|\n  'dual-namepath-referencing'|false) - Whether and how a name is allowed\n  following any type. Tags without a proper name (value `false`) may still\n  have a description (which can appear like a name); `descriptionAllowed`\n  in such cases would be `true`.\n  The presence of a truthy `nameContents` value is therefore only intended\n  to signify whether separate parsing should occur for a name vs. a\n  description, and what its nature should be.\n- `nameRequired` (boolean) - Whether a name must be present following any type.\n- `descriptionAllowed` (boolean) - Whether a description (following any name)\n  is allowed.\n- `typeAllowed` (boolean) - Whether the tag accepts a curly bracketed portion.\n  Even without a type, a tag may still have a name and/or description.\n- `typeRequired` (boolean) - Whether a curly bracketed type must be present.\n- `typeOrNameRequired` (boolean) - Whether either a curly bracketed type is\n  required or a name, but not necessarily both.\n\n### Miscellaneous\n\nAlso currently exports these utilities:\n\n- `getTokenizers` - Used with `parseComment` (its main core).\n- `hasSeeWithLink` - A utility to detect if a tag is `@see` and has a `@link`.\n- `commentHandler` - Used by `eslint-plugin-jsdoc`.\n- `commentParserToESTree`- Converts [comment-parser](https://github.com/syavorsky/comment-parser)\n  AST to ESTree/ESLint/Babel friendly AST.\n- `jsdocVisitorKeys` - The [VisitorKeys](https://github.com/eslint/eslint-visitor-keys)\n  for `JSDocBlock`, `JSDocDescriptionLine`, and `JSDocTag`.\n- `jsdocTypeVisitorKeys` - [VisitorKeys](https://github.com/eslint/eslint-visitor-keys)\n  for `jsdoc-type-pratt-parser`.\n- `defaultNoTypes` = The tags which allow no types by default:\n  `default`, `defaultvalue`, `description`, `example`, `file`,\n  `fileoverview`, `license`, `overview`, `see`, `summary`\n- `defaultNoNames` - The tags which allow no names by default:\n  `access`, `author`, `default`, `defaultvalue`, `description`, `example`,\n  `exception`, `file`, `fileoverview`, `kind`, `license`, `overview`,\n  `return`, `returns`, `since`, `summary`, `throws`, `version`, `variation`\n\n## ESLint AST produced for `comment-parser` nodes (`JsdocBlock`, `JsdocTag`, and `JsdocDescriptionLine`)\n\nNote: Although not added in this package, `@es-joy/jsdoc-eslint-parser` adds\na `jsdoc` property to other ES nodes (using this project's `getJSDocComment`\nto determine the specific comment-block that will be attached as AST).\n\n### `JsdocBlock`\n\nHas the following visitable properties:\n\n1. `descriptionLines` (an array of `JsdocDescriptionLine` for multiline\n   descriptions).\n1. `tags` (an array of `JsdocTag`; see below)\n1. `inlineTags` (an array of `JsdocInlineTag`; see below)\n\nHas the following custom non-visitable property:\n\n1. `delimiterLineBreak` - A string containing any line break after `delimiter`.\n2. `lastDescriptionLine` - A number\n3. `endLine` - A number representing the line number with `end`/`terminal`\n4. `descriptionStartLine` - A 0+ number indicating the line where any\n   description begins\n5. `descriptionEndLine` - A 0+ number indicating the line where the description\n   ends\n6. `hasPreterminalDescription` - Set to 0 or 1. On if has a block description\n   on the same line as the terminal `*/`.\n7. `hasPreterminalTagDescription` - Set to 0 or 1. On if has a tag description\n   on the same line as the terminal `*/`.\n8. `preterminalLineBreak` - A string containing any line break before `terminal`.\n\nMay also have the following non-visitable properties from `comment-parser`:\n\n1. `description` - Same as `descriptionLines` but as a string with newlines.\n2. `delimiter`\n3. `postDelimiter`\n4. `lineEnd`\n5. `initial` (from `start`)\n6. `terminal` (from `end`)\n\n### `JsdocTag`\n\nHas the following visitable properties:\n\n1. `parsedType` (the `jsdoc-type-pratt-parser` AST representation of the tag's\n   type (see the `jsdoc-type-pratt-parser` section below)).\n1. `typeLines` (an array of `JsdocTypeLine` for multiline type strings)\n1. `descriptionLines` (an array of `JsdocDescriptionLine` for multiline\n   descriptions)\n1. `inlineTags` (an array of `JsdocInlineTag`)\n\nMay also have the following non-visitable properties from `comment-parser`\n(note that all are included from `comment-parser` except `end` as that is only\nfor JSDoc blocks and note that `type` is renamed to `rawType` and `start` to\n`initial`):\n\n1. `description` - Same as `descriptionLines` but as a string with newlines.\n2. `rawType` - `comment-parser` has this named as `type`, but because of a\n   conflict with ESTree using `type` for Node type, we renamed it to\n   `rawType`. It is otherwise the same as in `comment-parser`, i.e., a string\n   with newlines, though with the initial `{` and final `}` stripped out.\n   See `typeLines` for the array version of this property.\n3. `initial` - Renamed from `start` to avoid potential conflicts with\n   Acorn-style parser processing tools\n4. `delimiter`\n5. `postDelimiter`\n6. `tag` (this does differ from `comment-parser` now in terms of our stripping\n   the initial `@`)\n7. `postTag`\n8. `name`\n9. `postName`\n10. `postType`\n\n### `JsdocDescriptionLine`\n\nNo visitable properties.\n\nMay also have the following non-visitable properties from `comment-parser`:\n\n1. `delimiter`\n2. `postDelimiter`\n3. `initial` (from `start`)\n4. `description`\n\n### `JsdocTypeLine`\n\nNo visitable properties.\n\nMay also have the following non-visitable properties from `comment-parser`:\n\n1. `delimiter`\n2. `postDelimiter`\n3. `initial` (from `start`)\n4. `rawType` - Renamed from `comment-parser` to avoid a conflict. See\n   explanation under `JsdocTag`\n\n### `JsdocInlineTag`\n\nNo visitable properties.\n\nHas the following non-visitable properties:\n\n1. `format`: 'pipe' | 'plain' | 'prefix' | 'space'. These follow the styles of [`@link`](https://jsdoc.app/tags-inline-link.html) or [`@tutorial`](https://jsdoc.app/tags-inline-tutorial.html).\n    1. `pipe`: `{@link namepathOrURL|link text}`\n    2. `plain`: `{@link namepathOrURL}`\n    3. `prefix`: `[link text]{@link namepathOrURL}`\n    4. `space`: `{@link namepathOrURL link text (after the first space)}`\n2. `namepathOrURL`: string\n3. `tag`: string. The standard allows `tutorial` or `link`\n4. `text`: string\n\n## ESLint AST produced for `jsdoc-type-pratt-parser`\n\nThe AST, including `type`, remains as is from [jsdoc-type-pratt-parser](https://github.com/simonseyock/jsdoc-type-pratt-parser/).\n\nThe type will always begin with a `JsdocType` prefix added, along with a\ncamel-cased type name, e.g., `JsdocTypeUnion`.\n\nThe `jsdoc-type-pratt-parser` visitor keys are also preserved without change.\n\nYou can get a sense of the structure of these types using the parser's\n[tester](https://jsdoc-type-pratt-parser.github.io/jsdoc-type-pratt-parser/).\n\n## Installation\n\n```shell\nnpm i @es-joy/jsdoccomment\n```\n\n## Changelog\n\nThe changelog can be found on the [CHANGES.md](https://github.com/es-joy/jsdoccomment/blob/main/CHANGES.md).\n\n<!--## Contributing\n\nEveryone is welcome to contribute. Please take a moment to review the [contributing guidelines](CONTRIBUTING.md).\n-->\n\n## Authors and license\n\n[Brett Zamir](http://brett-zamir.me/) and\n[contributors](https://github.com/es-joy/jsdoccomment/graphs/contributors).\n\nMIT License, see the included [LICENSE-MIT.txt](https://github.com/es-joy/jsdoccomment/blob/main/LICENSE-MIT.txt) file.\n\n## To-dos\n\n1. Get complete code coverage\n1. Given that `esquery` expects a `right` property to search for `>` (the\n   child selector), we should perhaps insist, for example, that params are\n   the child property for `JsdocBlock` or such. Where `:has()` is currently\n   needed, one could thus instead just use `>`.\n1. Might add `trailing` for `JsdocBlock` to know whether it is followed by a\n   line break or what not; `comment-parser` does not provide, however\n1. Fix and properly utilize `indent` argument (challenging for\n   `eslint-plugin-jsdoc` but needed for `jsdoc-eslint-parser` stringifiers\n   to be more faithful); should also then use the proposed `trailing` as well\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/es-joy/jsdoccomment\n","readmeFilename":"README.md","_rev":"1-f000528d49ebb9122276cc92ed333991"}