extra-jsdoc-text
TypeScript icon, indicating that this package has built-in type declarations

0.1.20 • Public • Published

Utilities for processing JSDoc text.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs.

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 <script> tag from the jsDelivr CDN.

Stability: Experimental.


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();


Index

Property Description
parse Parse jsdoc from jsdoc text.
stringify Stringify jsdoc text from parsed jsdoc.



ORG DOI

Package Sidebar

Install

npm i extra-jsdoc-text

Weekly Downloads

3

Version

0.1.20

License

BSD-3-Clause

Unpacked Size

9.54 kB

Total Files

6

Last publish

Collaborators

  • wolfram77