https://github.com/nodef/extra-jsdoc-text
Utilities for processing JSDoc text.
https://github.com/nodef/extra-jsdoc-text
extra jsdoc param-tag parse returns-tag stringify text
Last synced: 4 months ago
JSON representation
Utilities for processing JSDoc text.
- Host: GitHub
- URL: https://github.com/nodef/extra-jsdoc-text
- Owner: nodef
- License: mit
- Created: 2022-04-03T02:29:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T17:19:04.000Z (about 1 year ago)
- Last Synced: 2026-01-12T19:45:49.514Z (5 months ago)
- Topics: extra, jsdoc, param-tag, parse, returns-tag, stringify, text
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/extra-jsdoc-text
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
Utilities for processing JSDoc text.
📦 [Node.js](https://www.npmjs.com/package/extra-jsdoc-text),
🌐 [Web](https://www.npmjs.com/package/extra-jsdoc-text.web),
📜 [Files](https://unpkg.com/extra-jsdoc-text/),
📰 [Docs](https://nodef.github.io/extra-jsdoc-text/).
This package is available in *Node.js* and *Web* formats. To use it on the web,
simply use the `extra_jsdoc_text` global variable after loading with a ``
tag from the [jsDelivr CDN].
> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
[jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-jsdoc-text.web/index.js
<br>
```javascript
const xjsdoc = require('extra-jsdoc-text');
function main() {
var txt = `
/**
* Parse jsdoc from jsdoc text.
* @param txt jsdoc text
* @returns parsed jsdoc
*/
`, parse = null;
parse = xjsdoc.parse(txt);
// {
// full: '\n' +
// '/**\n' +
// ' * Parse jsdoc from jsdoc text.\n' +
// ' * @param txt jsdoc text\n' +
// ' * @returns parsed jsdoc\n' +
// ' */\n' +
// ' ',
// description: 'Parse jsdoc from jsdoc text.\n',
// params: [
// {
// full: '@param txt jsdoc text',
// name: 'txt',
// type: '',
// description: 'jsdoc text'
// }
// ],
// returns: {
// full: '@returns parsed jsdoc',
// type: '',
// description: 'parsed jsdoc'
// },
// examples: []
// }
parse.description += ' (only if simple)';
xjsdoc.stringify(parse);
// '/**\n' +
// ' * Parse jsdoc from jsdoc text.\n' +
// ' * (only if simple)\n' +
// ' * @param txt jsdoc text\n' +
// ' * @returns parsed jsdoc\n' +
// ' * */\n'
}
main();
```
<br>
<br>
## Index
| Property | Description |
| ---- | ---- |
| [parse] | Parse jsdoc from jsdoc text. |
| [stringify] | Stringify jsdoc text from parsed jsdoc. |
<br>
<br>
[](https://www.youtube.com/watch?v=dEGrVjb2dB4)<br>
[](https://nodef.github.io)
[](https://zenodo.org/badge/latestdoi/477219250)

[parse]: https://nodef.github.io/extra-jsdoc-text/modules.html#parse
[stringify]: https://nodef.github.io/extra-jsdoc-text/modules.html#stringify