├── .github └── workflows │ └── node.js.yml ├── .gitignore ├── LICENSE ├── README.md ├── bin └── cli.js ├── dist └── index.cjs ├── docs └── API.md ├── index.js ├── lib ├── cli-data.js ├── dmd-options.js └── jsdoc-options.js ├── package-lock.json ├── package.json └── test ├── async.js ├── cli.js └── fixture ├── ignore.js └── params.js /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 2 | 3 | name: Node.js CI 4 | 5 | on: 6 | push: 7 | branches: [ master, next ] 8 | pull_request: 9 | branches: [ master ] 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ${{ matrix.os }} 15 | 16 | strategy: 17 | matrix: 18 | os: [ubuntu-latest, windows-latest] 19 | node-version: [12, 14, 16, 18, 20, 22, 24] 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Use Node.js ${{ matrix.node-version }} 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: ${{ matrix.node-version }} 27 | cache: 'npm' 28 | - run: npm install 29 | - run: npm i -g @75lb/nature 30 | - run: npm run test:ci 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | tmp 3 | node_modules 4 | coverage 5 | tmp-test 6 | .coveralls.yml 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-24 Lloyd Brookes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![view on npm](https://badgen.net/npm/v/jsdoc-to-markdown)](https://www.npmjs.org/package/jsdoc-to-markdown) 2 | [![npm module downloads](https://badgen.net/npm/dt/jsdoc-to-markdown)](https://www.npmjs.org/package/jsdoc-to-markdown) 3 | [![Gihub repo dependents](https://badgen.net/github/dependents-repo/jsdoc2md/jsdoc-to-markdown)](https://github.com/jsdoc2md/jsdoc-to-markdown/network/dependents?dependent_type=REPOSITORY) 4 | [![Gihub package dependents](https://badgen.net/github/dependents-pkg/jsdoc2md/jsdoc-to-markdown)](https://github.com/jsdoc2md/jsdoc-to-markdown/network/dependents?dependent_type=PACKAGE) 5 | [![Node.js CI](https://github.com/jsdoc2md/jsdoc-to-markdown/actions/workflows/node.js.yml/badge.svg)](https://github.com/jsdoc2md/jsdoc-to-markdown/actions/workflows/node.js.yml) 6 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) 7 | 8 | _Upgraders, please read the [release notes](https://github.com/jsdoc2md/jsdoc-to-markdown/releases)_ 9 | 10 | # jsdoc-to-markdown 11 | 12 | Generates markdown API documentation from [jsdoc](https://jsdoc.app) annotated source code. Useful for injecting API docs into project README files. 13 | 14 | ## Synopsis 15 | 16 | 1\. Document your code using valid jsdoc comments. 17 | 18 | ```js 19 | /** 20 | * A quite wonderful function. 21 | * @param {object} - Privacy gown 22 | * @param {object} - Security 23 | * @returns {survival} 24 | */ 25 | function protection (cloak, dagger) {} 26 | ``` 27 | 28 | 2\. Run a command. 29 | 30 | ```sh 31 | $ jsdoc2md example.js 32 | ``` 33 | 34 | 3\. Get markdown output. 35 | 36 | ```markdown 37 | ## protection(cloak, dagger) ⇒ survival 38 | A quite wonderful function. 39 | 40 | **Kind**: global function 41 | 42 | | Param | Type | Description | 43 | | ------ | ------------------- | ------------ | 44 | | cloak | object | Privacy gown | 45 | | dagger | object | Security | 46 | 47 | ``` 48 | 49 | ## Install 50 | 51 | ``` 52 | $ npm install --save-dev jsdoc-to-markdown 53 | ``` 54 | 55 | ## See also 56 | 57 | * [API documentation](https://github.com/jsdoc2md/jsdoc-to-markdown/blob/master/docs/API.md) 58 | * The [wiki](https://github.com/jsdoc2md/jsdoc-to-markdown/wiki) for example output, FAQs, tutorials, plugins, use with gulp/grunt etc. 59 | 60 | * * * 61 | 62 | © 2014-24 Lloyd Brookes \. 63 | 64 | Tested by [test-runner](https://github.com/test-runner-js/test-runner). 65 | -------------------------------------------------------------------------------- /bin/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import commandLineArgs from 'command-line-args' 3 | import commandLineUsage from 'command-line-usage' 4 | import jsdoc2md from 'jsdoc-to-markdown' 5 | import assert from 'assert' 6 | import fs from 'fs' 7 | import loadConfig from 'config-master' 8 | import cliData from '../lib/cli-data.js' 9 | import path from 'node:path' 10 | import url from 'node:url' 11 | const __dirname = url.fileURLToPath(path.dirname(import.meta.url)) 12 | 13 | const cli = parseCommandLine() 14 | let options = cli.options._all 15 | options = loadStoredConfig(options) 16 | 17 | /* jsdoc2md --help */ 18 | if (options.help) { 19 | console.log(cli.usage) 20 | 21 | /* jsdoc2md --version */ 22 | } else if (options.version) { 23 | const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8')) 24 | console.log(pkg.version) 25 | 26 | /* jsdoc2md --clear */ 27 | } else if (options.clear) { 28 | jsdoc2md._interface = 'cli' 29 | jsdoc2md.clear().catch(handleError) 30 | } else { 31 | jsdoc2md._interface = 'cli' 32 | 33 | /* jsdoc2md --config */ 34 | if (options.config) { 35 | delete options.config 36 | console.log(JSON.stringify(options, null, ' ')) 37 | process.exit(0) 38 | } 39 | 40 | /* input files (jsdoc-options) required from here */ 41 | /* input validation */ 42 | options.files = options.files || [] 43 | if (!(options.files.length || options.source || options.configure)) { 44 | console.error('Must supply either --files, --source or --configure') 45 | console.log(cli.usage) 46 | process.exit(1) 47 | } 48 | 49 | /* jsdoc2md --json */ 50 | if (options.json) { 51 | jsdoc2md.getTemplateData(options) 52 | .then(function (json) { 53 | console.log(JSON.stringify(json, null, ' ')) 54 | }) 55 | .catch(handleError) 56 | 57 | /* jsdoc2md --jsdoc */ 58 | } else if (options.jsdoc) { 59 | jsdoc2md 60 | .getJsdocData(options) 61 | .then(function (json) { 62 | console.log(JSON.stringify(json, null, ' ')) 63 | }) 64 | .catch(handleError) 65 | 66 | /* jsdoc2md --namepaths */ 67 | } else if (options.namepaths) { 68 | jsdoc2md 69 | .getNamepaths(options) 70 | .then(function (namepaths) { 71 | console.log(JSON.stringify(namepaths, null, ' ')) 72 | }) 73 | .catch(handleError) 74 | 75 | /* jsdoc2md [] --src */ 76 | } else { 77 | if (options.template) options.template = fs.readFileSync(options.template, 'utf8') 78 | 79 | jsdoc2md 80 | .render(options) 81 | .then(output => { 82 | process.stdout.write(output) 83 | process.exit(0) 84 | }) 85 | .catch(handleError) 86 | } 87 | } 88 | 89 | function loadStoredConfig (options) { 90 | const jsdoc2mdConfig = loadConfig('jsdoc2md') 91 | return Object.assign(jsdoc2mdConfig, options) 92 | } 93 | 94 | function parseCommandLine () { 95 | const usage = cliData.usageSections ? commandLineUsage(cliData.usageSections) : '' 96 | const options = commandLineArgs(cliData.definitions) 97 | return { options, usage } 98 | } 99 | 100 | function handleError (err) { 101 | console.error(err) 102 | process.exit(1) 103 | } 104 | -------------------------------------------------------------------------------- /dist/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var jsdocApi = require('jsdoc-api'); 4 | var dmd = require('dmd'); 5 | var jsdocParse = require('jsdoc-parse'); 6 | 7 | /** 8 | * @typicalname options 9 | */ 10 | class DmdOptions { 11 | constructor (options) { 12 | Object.assign(this, options); 13 | this.noCache = options['no-cache']; 14 | delete this['no-cache']; 15 | } 16 | } 17 | 18 | class JsdocOptions { 19 | constructor (options) { 20 | Object.assign(this, options); 21 | this.cache = !options['no-cache']; 22 | delete this['no-cache']; 23 | /* Remove the dmd `template` option - it will break jsdoc-api if passed in as the `template` option must be a filename */ 24 | delete this.template; 25 | } 26 | } 27 | 28 | /** 29 | * @module jsdoc-to-markdown 30 | * @example 31 | * import jsdoc2md from 'jsdoc-to-markdown' 32 | */ 33 | 34 | /** 35 | * @alias module:jsdoc-to-markdown 36 | * @typicalname jsdoc2md 37 | */ 38 | class JsdocToMarkdown { 39 | /** 40 | * Returns markdown documentation from jsdoc-annoted source code. 41 | * 42 | * @param [options] {object} - Accepts all {@link module:jsdoc-to-markdown#getJsdocData} options plus the following: 43 | * @param [options.data] {object[]} - Raw template data to use. Useful when you already have template data, obtained from `.getTemplateData()`. In the options, one of `files`, `source`, , `configure` or `data` must be supplied. 44 | * @param [options.template] {string} - The handlebars template the supplied documentation will be rendered into. Enables full control over the output. 45 | * @param [options.heading-depth] {number} - The initial heading depth. For example, with a value of `2` the top-level markdown headings look like `"## The heading"`. 46 | * @param [options.example-lang] {string} - Specifies the default language used in @example blocks (for [syntax-highlighting](https://help.github.com/articles/github-flavored-markdown/#syntax-highlighting) purposes). In gfm mode, each @example is wrapped in a fenced-code block. Example usage: `--example-lang js`. Use the special value `none` for no specific language. While using this option, you can override the supplied language for any @example by specifying the `@lang` subtag, e.g `@example @lang hbs`. Specifying `@example @lang off` will disable code blocks for that example. 47 | * @param [options.plugin] {string|string[]} - Use an installed package containing helper and/or partial overrides. 48 | * @param [options.helper] {string|string[]} - handlebars helper files to override or extend the default set. 49 | * @param [options.partial] {string|string[]} - handlebars partial files to override or extend the default set. 50 | * @param [options.name-format] {string} - Format identifier names as code (i.e. wrap function/property/class etc names in backticks). 51 | * @param [options.no-gfm] {boolean} - By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. 52 | * @param [options.separators] {boolean} - Put `
` breaks between identifiers. Improves readability on bulky docs. 53 | * @param [options.module-index-format] {string} - none, grouped, table, dl. 54 | * @param [options.global-index-format] {} - none, grouped, table, dl. 55 | * @param [options.param-list-format] {} - Two options to render parameter lists: 'list' or 'table' (default). Table format works well in most cases but switch to list if things begin to look crowded / squashed. 56 | * @param [options.property-list-format] {} - list, table. 57 | * @param [options.member-index-format] {} - grouped, list 58 | * @param [options.clever-links] {boolean} - By default, all {@link} tags are rendered in plain text. If `--clever-links` is set, URL {@link} tags are rendered in plain text, otherwise monospace. 59 | * @param [options.monospace-links] {boolean} - By default, all {@link} tags are rendered in plain text. If `--monospace-links` is set, all links are rendered in monospace format. This setting is ignored if `--clever-links` is set. 60 | * @param [options.EOL] {string} - Specify ether `posix` or `win32`. Forces all line endings in the dmd output to use the specified EOL character - can help to avoid scenarios where files contain mixed line-endings. 61 | * @return {Promise} 62 | * @fulfil {string} - the rendered docs 63 | * @category async 64 | * @example 65 | * Pass in filepaths (`**` glob matching supported) of javascript source files: 66 | * ```js 67 | * > const apiDocs = await jsdoc2md.render({ files: 'lib/*.js' }) 68 | * ``` 69 | */ 70 | async render (options = {}) { 71 | const dmdOptions = new DmdOptions(options); 72 | if (options.data) { 73 | return dmd(options.data, dmdOptions) 74 | } else { 75 | const templateData = await this.getTemplateData(options); 76 | return dmd(templateData, dmdOptions) 77 | } 78 | } 79 | 80 | /** 81 | * Returns the template data (jsdoc-parse output) which is fed into the output template (dmd). 82 | * 83 | * @param [options] {object} - Identical options to {@link module:jsdoc-to-markdown#getJsdocData}. 84 | * @return {Promise} 85 | * @fulfil {object[]} - the json data 86 | * @category async 87 | */ 88 | async getTemplateData (options = {}) { 89 | const jsdocData = await this.getJsdocData(options); 90 | return jsdocParse(jsdocData) 91 | } 92 | 93 | /** 94 | * Returns raw data direct from the underlying [jsdoc3](https://github.com/jsdoc3/jsdoc). 95 | * 96 | * @param [options] {object} - the options 97 | * @param [options.no-cache] {boolean} - By default results are cached to speed up repeat invocations with the same input. Set to true to disable this. 98 | * @param [options.files] {string|string[]} - One or more filenames to process. Accepts globs (e.g. `*.js`). Either `files`, `source` or `configure` must be supplied. 99 | * @param [options.source] {string} - A string containing source code to process. One of `files`, `source` or `configure` must be supplied. 100 | * @param [options.configure] {string} - The path to the [jsdoc configuration file](https://jsdoc.app/about-configuring-jsdoc.html). Default: path/to/jsdoc/conf.json. One of `files`, `source` or `configure` must be supplied. 101 | * @return {Promise} 102 | * @fulfil {object[]} 103 | * @category async 104 | */ 105 | async getJsdocData (options) { 106 | const jsdocOptions = new JsdocOptions(options); 107 | return jsdocApi.explain(jsdocOptions) 108 | } 109 | 110 | /** 111 | * By default, the output of each invocation of the main generation methods (`render`, `getTemplateData` etc) is stored in the cache (your system's [temporary directory](https://nodejs.org/dist/latest-v6.x/docs/api/os.html#os_os_tmpdir)). Future jsdoc2md invocations with the same input options and source code will return the output immediately from cache, making the tool much faster/cheaper. If the input options or source code changes, fresh output will be generated. This method clears the cache, which you should never need to do unless the cache is failing for some reason. On Mac OSX, the system tmpdir clears itself every few days meaning your jsdoc2md cache will also be routinely cleared. 112 | * @returns {Promise} 113 | * @category async 114 | */ 115 | async clear () { 116 | await jsdocApi.cache.clear(); 117 | await dmd.cache.clear(); 118 | } 119 | 120 | /** 121 | * Returns all [jsdoc namepaths](https://jsdoc.app/about-namepaths.html) found in the supplied source code. 122 | * @param {object} - options to pass to {@link module:jsdoc-to-markdown#getTemplateData} 123 | * @returns {object} 124 | * @category async 125 | */ 126 | async getNamepaths (options) { 127 | const data = await this.getTemplateData(options); 128 | const namepaths = {}; 129 | const kinds = [ 130 | 'module', 'class', 'constructor', 'mixin', 'member', 131 | 'namespace', 'constant', 'function', 'event', 'typedef', 'external' 132 | ]; 133 | for (const kind of kinds) { 134 | namepaths[kind] = data 135 | .filter(identifier => identifier.kind === kind) 136 | .map(identifier => identifier.longname); 137 | } 138 | return namepaths 139 | } 140 | } 141 | 142 | var index = new JsdocToMarkdown(); 143 | 144 | module.exports = index; 145 | -------------------------------------------------------------------------------- /docs/API.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # jsdoc-to-markdown 4 | **Example** 5 | ```js 6 | import jsdoc2md from 'jsdoc-to-markdown' 7 | ``` 8 | 9 | * [jsdoc-to-markdown](#module_jsdoc-to-markdown) 10 | * [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) ⏏ 11 | * [.render([options])](#module_jsdoc-to-markdown--JsdocToMarkdown+render) ⇒ Promise.<string> 12 | * [.getTemplateData([options])](#module_jsdoc-to-markdown--JsdocToMarkdown+getTemplateData) ⇒ Promise.<Array.<object>> 13 | * [.getJsdocData([options])](#module_jsdoc-to-markdown--JsdocToMarkdown+getJsdocData) ⇒ Promise.<Array.<object>> 14 | * [.clear()](#module_jsdoc-to-markdown--JsdocToMarkdown+clear) ⇒ Promise 15 | * [.getNamepaths(options)](#module_jsdoc-to-markdown--JsdocToMarkdown+getNamepaths) ⇒ object 16 | 17 | 18 | 19 | ## JsdocToMarkdown ⏏ 20 | **Kind**: Exported class 21 | 22 | 23 | ### jsdoc2md.render([options]) ⇒ Promise.<string> 24 | Returns markdown documentation from jsdoc-annoted source code. 25 | 26 | **Kind**: instance method of [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) 27 | **Category**: async 28 | **Fulfil**: string - the rendered docs 29 | 30 | | Param | Type | Description | 31 | | --- | --- | --- | 32 | | [options] | object | Accepts all [getJsdocData](#module_jsdoc-to-markdown--JsdocToMarkdown+getJsdocData) options plus the following: | 33 | | [options.data] | Array.<object> | Raw template data to use. Useful when you already have template data, obtained from `.getTemplateData()`. In the options, one of `files`, `source`, , `configure` or `data` must be supplied. | 34 | | [options.template] | string | The handlebars template the supplied documentation will be rendered into. Enables full control over the output. | 35 | | [options.heading-depth] | number | The initial heading depth. For example, with a value of `2` the top-level markdown headings look like `"## The heading"`. | 36 | | [options.example-lang] | string | Specifies the default language used in @example blocks (for [syntax-highlighting](https://help.github.com/articles/github-flavored-markdown/#syntax-highlighting) purposes). In gfm mode, each @example is wrapped in a fenced-code block. Example usage: `--example-lang js`. Use the special value `none` for no specific language. While using this option, you can override the supplied language for any @example by specifying the `@lang` subtag, e.g `@example @lang hbs`. Specifying `@example @lang off` will disable code blocks for that example. | 37 | | [options.plugin] | string \| Array.<string> | Use an installed package containing helper and/or partial overrides. | 38 | | [options.helper] | string \| Array.<string> | handlebars helper files to override or extend the default set. | 39 | | [options.partial] | string \| Array.<string> | handlebars partial files to override or extend the default set. | 40 | | [options.name-format] | string | Format identifier names as code (i.e. wrap function/property/class etc names in backticks). | 41 | | [options.no-gfm] | boolean | By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. | 42 | | [options.separators] | boolean | Put `
` breaks between identifiers. Improves readability on bulky docs. | 43 | | [options.module-index-format] | string | none, grouped, table, dl. | 44 | | [options.global-index-format] | | none, grouped, table, dl. | 45 | | [options.param-list-format] | | Two options to render parameter lists: 'list' or 'table' (default). Table format works well in most cases but switch to list if things begin to look crowded / squashed. | 46 | | [options.property-list-format] | | list, table. | 47 | | [options.member-index-format] | | grouped, list | 48 | | [options.clever-links] | boolean | By default, all {@link} tags are rendered in plain text. If `--clever-links` is set, URL {@link} tags are rendered in plain text, otherwise monospace. | 49 | | [options.monospace-links] | boolean | By default, all {@link} tags are rendered in plain text. If `--monospace-links` is set, all links are rendered in monospace format. This setting is ignored if `--clever-links` is set. | 50 | | [options.EOL] | string | Specify ether `posix` or `win32`. Forces all line endings in the dmd output to use the specified EOL character - can help to avoid scenarios where files contain mixed line-endings. | 51 | 52 | **Example** 53 | Pass in filepaths (`**` glob matching supported) of javascript source files: 54 | ```js 55 | > const apiDocs = await jsdoc2md.render({ files: 'lib/*.js' }) 56 | ``` 57 | 58 | 59 | ### jsdoc2md.getTemplateData([options]) ⇒ Promise.<Array.<object>> 60 | Returns the template data (jsdoc-parse output) which is fed into the output template (dmd). 61 | 62 | **Kind**: instance method of [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) 63 | **Category**: async 64 | **Fulfil**: object[] - the json data 65 | 66 | | Param | Type | Description | 67 | | --- | --- | --- | 68 | | [options] | object | Identical options to [getJsdocData](#module_jsdoc-to-markdown--JsdocToMarkdown+getJsdocData). | 69 | 70 | 71 | 72 | ### jsdoc2md.getJsdocData([options]) ⇒ Promise.<Array.<object>> 73 | Returns raw data direct from the underlying [jsdoc3](https://github.com/jsdoc3/jsdoc). 74 | 75 | **Kind**: instance method of [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) 76 | **Category**: async 77 | **Fulfil**: object[] 78 | 79 | | Param | Type | Description | 80 | | --- | --- | --- | 81 | | [options] | object | the options | 82 | | [options.no-cache] | boolean | By default results are cached to speed up repeat invocations with the same input. Set to true to disable this. | 83 | | [options.files] | string \| Array.<string> | One or more filenames to process. Accepts globs (e.g. `*.js`). Either `files`, `source` or `configure` must be supplied. | 84 | | [options.source] | string | A string containing source code to process. One of `files`, `source` or `configure` must be supplied. | 85 | | [options.configure] | string | The path to the [jsdoc configuration file](https://jsdoc.app/about-configuring-jsdoc.html). Default: path/to/jsdoc/conf.json. One of `files`, `source` or `configure` must be supplied. | 86 | 87 | 88 | 89 | ### jsdoc2md.clear() ⇒ Promise 90 | By default, the output of each invocation of the main generation methods (`render`, `getTemplateData` etc) is stored in the cache (your system's [temporary directory](https://nodejs.org/dist/latest-v6.x/docs/api/os.html#os_os_tmpdir)). Future jsdoc2md invocations with the same input options and source code will return the output immediately from cache, making the tool much faster/cheaper. If the input options or source code changes, fresh output will be generated. This method clears the cache, which you should never need to do unless the cache is failing for some reason. On Mac OSX, the system tmpdir clears itself every few days meaning your jsdoc2md cache will also be routinely cleared. 91 | 92 | **Kind**: instance method of [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) 93 | **Category**: async 94 | 95 | 96 | ### jsdoc2md.getNamepaths(options) ⇒ object 97 | Returns all [jsdoc namepaths](https://jsdoc.app/about-namepaths.html) found in the supplied source code. 98 | 99 | **Kind**: instance method of [JsdocToMarkdown](#exp_module_jsdoc-to-markdown--JsdocToMarkdown) 100 | **Category**: async 101 | 102 | | Param | Type | Description | 103 | | --- | --- | --- | 104 | | options | object | options to pass to [getTemplateData](#module_jsdoc-to-markdown--JsdocToMarkdown+getTemplateData) | 105 | 106 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import jsdocApi from 'jsdoc-api' 2 | import dmd from 'dmd' 3 | import DmdOptions from './lib/dmd-options.js' 4 | import JsdocOptions from './lib/jsdoc-options.js' 5 | import jsdocParse from 'jsdoc-parse' 6 | 7 | /** 8 | * @module jsdoc-to-markdown 9 | * @example 10 | * import jsdoc2md from 'jsdoc-to-markdown' 11 | */ 12 | 13 | /** 14 | * @alias module:jsdoc-to-markdown 15 | * @typicalname jsdoc2md 16 | */ 17 | class JsdocToMarkdown { 18 | /** 19 | * Returns markdown documentation from jsdoc-annoted source code. 20 | * 21 | * @param [options] {object} - Accepts all {@link module:jsdoc-to-markdown#getJsdocData} options plus the following: 22 | * @param [options.data] {object[]} - Raw template data to use. Useful when you already have template data, obtained from `.getTemplateData()`. In the options, one of `files`, `source`, , `configure` or `data` must be supplied. 23 | * @param [options.template] {string} - The handlebars template the supplied documentation will be rendered into. Enables full control over the output. 24 | * @param [options.heading-depth] {number} - The initial heading depth. For example, with a value of `2` the top-level markdown headings look like `"## The heading"`. 25 | * @param [options.example-lang] {string} - Specifies the default language used in @example blocks (for [syntax-highlighting](https://help.github.com/articles/github-flavored-markdown/#syntax-highlighting) purposes). In gfm mode, each @example is wrapped in a fenced-code block. Example usage: `--example-lang js`. Use the special value `none` for no specific language. While using this option, you can override the supplied language for any @example by specifying the `@lang` subtag, e.g `@example @lang hbs`. Specifying `@example @lang off` will disable code blocks for that example. 26 | * @param [options.plugin] {string|string[]} - Use an installed package containing helper and/or partial overrides. 27 | * @param [options.helper] {string|string[]} - handlebars helper files to override or extend the default set. 28 | * @param [options.partial] {string|string[]} - handlebars partial files to override or extend the default set. 29 | * @param [options.name-format] {string} - Format identifier names as code (i.e. wrap function/property/class etc names in backticks). 30 | * @param [options.no-gfm] {boolean} - By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. 31 | * @param [options.separators] {boolean} - Put `
` breaks between identifiers. Improves readability on bulky docs. 32 | * @param [options.module-index-format] {string} - none, grouped, table, dl. 33 | * @param [options.global-index-format] {} - none, grouped, table, dl. 34 | * @param [options.param-list-format] {} - Two options to render parameter lists: 'list' or 'table' (default). Table format works well in most cases but switch to list if things begin to look crowded / squashed. 35 | * @param [options.property-list-format] {} - list, table. 36 | * @param [options.member-index-format] {} - grouped, list 37 | * @param [options.clever-links] {boolean} - By default, all {@link} tags are rendered in plain text. If `--clever-links` is set, URL {@link} tags are rendered in plain text, otherwise monospace. 38 | * @param [options.monospace-links] {boolean} - By default, all {@link} tags are rendered in plain text. If `--monospace-links` is set, all links are rendered in monospace format. This setting is ignored if `--clever-links` is set. 39 | * @param [options.EOL] {string} - Specify ether `posix` or `win32`. Forces all line endings in the dmd output to use the specified EOL character - can help to avoid scenarios where files contain mixed line-endings. 40 | * @return {Promise} 41 | * @fulfil {string} - the rendered docs 42 | * @category async 43 | * @example 44 | * Pass in filepaths (`**` glob matching supported) of javascript source files: 45 | * ```js 46 | * > const apiDocs = await jsdoc2md.render({ files: 'lib/*.js' }) 47 | * ``` 48 | */ 49 | async render (options = {}) { 50 | const dmdOptions = new DmdOptions(options) 51 | if (options.data) { 52 | return dmd(options.data, dmdOptions) 53 | } else { 54 | const templateData = await this.getTemplateData(options) 55 | return dmd(templateData, dmdOptions) 56 | } 57 | } 58 | 59 | /** 60 | * Returns the template data (jsdoc-parse output) which is fed into the output template (dmd). 61 | * 62 | * @param [options] {object} - Identical options to {@link module:jsdoc-to-markdown#getJsdocData}. 63 | * @return {Promise} 64 | * @fulfil {object[]} - the json data 65 | * @category async 66 | */ 67 | async getTemplateData (options = {}) { 68 | const jsdocData = await this.getJsdocData(options) 69 | return jsdocParse(jsdocData) 70 | } 71 | 72 | /** 73 | * Returns raw data direct from the underlying [jsdoc3](https://github.com/jsdoc3/jsdoc). 74 | * 75 | * @param [options] {object} - the options 76 | * @param [options.no-cache] {boolean} - By default results are cached to speed up repeat invocations with the same input. Set to true to disable this. 77 | * @param [options.files] {string|string[]} - One or more filenames to process. Accepts globs (e.g. `*.js`). Either `files`, `source` or `configure` must be supplied. 78 | * @param [options.source] {string} - A string containing source code to process. One of `files`, `source` or `configure` must be supplied. 79 | * @param [options.configure] {string} - The path to the [jsdoc configuration file](https://jsdoc.app/about-configuring-jsdoc.html). Default: path/to/jsdoc/conf.json. One of `files`, `source` or `configure` must be supplied. 80 | * @return {Promise} 81 | * @fulfil {object[]} 82 | * @category async 83 | */ 84 | async getJsdocData (options) { 85 | const jsdocOptions = new JsdocOptions(options) 86 | return jsdocApi.explain(jsdocOptions) 87 | } 88 | 89 | /** 90 | * By default, the output of each invocation of the main generation methods (`render`, `getTemplateData` etc) is stored in the cache (your system's [temporary directory](https://nodejs.org/dist/latest-v6.x/docs/api/os.html#os_os_tmpdir)). Future jsdoc2md invocations with the same input options and source code will return the output immediately from cache, making the tool much faster/cheaper. If the input options or source code changes, fresh output will be generated. This method clears the cache, which you should never need to do unless the cache is failing for some reason. On Mac OSX, the system tmpdir clears itself every few days meaning your jsdoc2md cache will also be routinely cleared. 91 | * @returns {Promise} 92 | * @category async 93 | */ 94 | async clear () { 95 | await jsdocApi.cache.clear() 96 | await dmd.cache.clear() 97 | } 98 | 99 | /** 100 | * Returns all [jsdoc namepaths](https://jsdoc.app/about-namepaths.html) found in the supplied source code. 101 | * @param {object} - options to pass to {@link module:jsdoc-to-markdown#getTemplateData} 102 | * @returns {object} 103 | * @category async 104 | */ 105 | async getNamepaths (options) { 106 | const data = await this.getTemplateData(options) 107 | const namepaths = {} 108 | const kinds = [ 109 | 'module', 'class', 'constructor', 'mixin', 'member', 110 | 'namespace', 'constant', 'function', 'event', 'typedef', 'external' 111 | ] 112 | for (const kind of kinds) { 113 | namepaths[kind] = data 114 | .filter(identifier => identifier.kind === kind) 115 | .map(identifier => identifier.longname) 116 | } 117 | return namepaths 118 | } 119 | } 120 | 121 | export default new JsdocToMarkdown() 122 | -------------------------------------------------------------------------------- /lib/cli-data.js: -------------------------------------------------------------------------------- 1 | /* generation options */ 2 | const jsdocDefinitions = [ 3 | { 4 | name: 'files', 5 | alias: 'f', 6 | type: String, 7 | multiple: true, 8 | defaultOption: true, 9 | description: 'A list of jsdoc explain files (or glob expressions) to parse for documentation. Either this or {bold --source} must be supplied.', 10 | typeLabel: '{underline file} ...' 11 | }, 12 | { 13 | name: 'source', 14 | type: String, 15 | description: 'A string containing source code to parse for documentation. Either this or {bold --files} must be supplied.' 16 | }, 17 | { 18 | name: 'configure', 19 | alias: 'c', 20 | type: String, 21 | typeLabel: '{underline file}', 22 | description: 'Path to a jsdoc configuration file, passed directly to `jsdoc -c`.' 23 | }, 24 | { 25 | name: 'namepaths', 26 | type: Boolean, 27 | description: 'Print namepaths.' 28 | } 29 | ] 30 | 31 | const jsdoc2mdDefinitions = [ 32 | { 33 | name: 'help', 34 | description: 'Print usage information', 35 | alias: 'h', 36 | type: Boolean 37 | }, 38 | { 39 | name: 'config', 40 | description: 'Print all options supplied (from command line, `.jsdoc2md.json` or `package.json` under the `jsdoc2md` property) and exit. Useful for checking the tool is receiving the correct config.', 41 | type: Boolean 42 | }, 43 | { 44 | name: 'json', 45 | type: Boolean, 46 | description: 'Prints the data (jsdoc-parse output) supplied to the template (dmd).' 47 | }, 48 | { 49 | name: 'jsdoc', 50 | type: Boolean, 51 | description: 'Prints the raw jsdoc data.' 52 | }, 53 | { name: 'version', type: Boolean }, 54 | { 55 | name: 'no-cache', 56 | type: Boolean, 57 | description: 'By default, repeat invocations against the same input with the same options returns from cache. This option disables that. ' 58 | }, 59 | { 60 | name: 'clear', 61 | type: Boolean, 62 | description: 'Clears the cache.' 63 | } 64 | ] 65 | 66 | const dmdDefinitions = [ 67 | { 68 | name: 'template', 69 | alias: 't', 70 | type: String, 71 | typeLabel: '', 72 | description: 'A custom handlebars template file to insert documentation into. The default template is `\\{\\{>main\\}\\}`.' 73 | }, 74 | { 75 | name: 'private', 76 | type: Boolean, 77 | description: 'Include identifiers marked {bold @private} in the output' 78 | }, 79 | { 80 | name: 'heading-depth', 81 | type: Number, 82 | alias: 'd', 83 | description: 'Root markdown heading depth, defaults to 2 ({bold ##}).' 84 | }, 85 | { 86 | name: 'plugin', 87 | type: String, 88 | typeLabel: '{underline module} ...', 89 | multiple: true, 90 | description: 'Use an installed package containing helper and/or partial overrides.' 91 | }, 92 | { 93 | name: 'helper', 94 | type: String, 95 | typeLabel: '{underline module} ...', 96 | multiple: true, 97 | description: 'Handlebars helper modules to override or extend the default set.' 98 | }, 99 | { 100 | name: 'partial', 101 | type: String, 102 | typeLabel: '{underline file} ...', 103 | multiple: true, 104 | description: 'Handlebars partial files to override or extend the default set.' 105 | }, 106 | { 107 | name: 'example-lang', 108 | type: String, 109 | alias: 'l', 110 | description: 'Specifies the default language used in {bold @example} blocks (for syntax-highlighting purposes). In the default gfm mode, each {bold @example} is wrapped in a fenced-code block. Example usage: {bold --example-lang js}. Use the special value {bold none} for no specific language. While using this option, you can override the supplied language for any {bold @example} by specifying the {bold @lang} subtag, e.g {bold @example @lang hbs}. Specifying {bold @example @lang off} will disable code blocks for that example.' 111 | }, 112 | { name: 'name-format', type: Boolean, description: 'Format identifier names as code (i.e. wrap function/property/class etc names in backticks).' }, 113 | { 114 | name: 'no-gfm', 115 | type: Boolean, 116 | description: 'By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. ' 117 | }, 118 | { 119 | name: 'separators', 120 | type: Boolean, 121 | description: 'Put {bold
} breaks between identifiers. Improves readability on bulky docs. ' 122 | }, 123 | { 124 | name: 'module-index-format', 125 | type: String, 126 | alias: 'm', 127 | description: 'When muliple modules are found in the input source code, an index is generated. It can be styled by one of the following options: {bold none}, {bold grouped}, {bold table} or {bold dl}.' 128 | }, 129 | { 130 | name: 'global-index-format', 131 | type: String, 132 | alias: 'g', 133 | description: 'When muliple global-scope identifiers are found in the input source code, an index is generated. It can be styled by one of the following options: {bold none}, {bold grouped}, {bold table} or {bold dl}.' 134 | }, 135 | { 136 | name: 'param-list-format', 137 | type: String, 138 | alias: 'p', 139 | description: 'Two options to render {bold @param} lists: {bold list} or {bold table} (default). Table format works well in most cases but switch to {bold list} if things begin to look crowded. ' 140 | }, 141 | { 142 | name: 'property-list-format', 143 | type: String, 144 | alias: 'r', 145 | description: 'Two options to render {bold @property} lists: {bold list} or {bold table} (default).' 146 | }, 147 | { 148 | name: 'member-index-format', 149 | type: String, 150 | description: 'Two options to render member lists: {bold list} or {bold grouped} (default). The {bold list} view is loosely-based on the nodejs docs.' 151 | }, 152 | { 153 | name: 'clever-links', 154 | type: Boolean, 155 | description: 'By default, all {bold \\{@link\\}} tags are rendered in plain text. If `--clever-links` is set, URL \\{@link\\} tags are rendered in plain text, otherwise monospace.' 156 | }, 157 | { 158 | name: 'monospace-links', 159 | type: Boolean, 160 | description: 'By default, all {bold \\{@link\\}} tags are rendered in plain text. If `--monospace-links` is set, all links are rendered in monospace format. This setting is ignored if {bold `--clever-links`} is set.' 161 | }, 162 | { 163 | name: 'EOL', 164 | type: String, 165 | description: 'Specify ether `posix` or `win32`. Forces all line endings in the dmd output to use the specified EOL character.' 166 | } 167 | ] 168 | 169 | /* mix in the jsdoc-parse and dmd options */ 170 | const definitions = jsdocDefinitions 171 | .map(def => { 172 | def.group = 'jsdoc' 173 | return def 174 | }) 175 | .concat(jsdoc2mdDefinitions.map(def => { 176 | def.group = 'jsdoc2md' 177 | return def 178 | })) 179 | .concat(dmdDefinitions.map(function (def) { 180 | def.group = 'dmd' 181 | return def 182 | })) 183 | 184 | export default { 185 | definitions: definitions, 186 | usageSections: [ 187 | { 188 | header: 'jsdoc-to-markdown', 189 | content: 'Generates markdown documentation from jsdoc-annotated source code.' 190 | }, 191 | { 192 | header: 'Synopsis', 193 | content: [ 194 | { 195 | cmmd: '$ jsdoc2md []' 196 | }, 197 | { 198 | cmmd: '$ jsdoc2md {bold --jsdoc}' 199 | }, 200 | { 201 | cmmd: '$ jsdoc2md {bold --json}' 202 | }, 203 | { 204 | cmmd: '$ jsdoc2md {bold --namepaths}' 205 | }, 206 | { 207 | cmmd: '$ jsdoc2md {bold --help}' 208 | }, 209 | { 210 | cmmd: '$ jsdoc2md {bold --config}' 211 | } 212 | ] 213 | }, 214 | { 215 | header: 'General options', 216 | content: 'Main options affecting mode. If none of the following are supplied, the tool will generate markdown docs.' 217 | }, 218 | { 219 | optionList: jsdoc2mdDefinitions 220 | }, 221 | { 222 | header: 'jsdoc options', 223 | content: 'Options regarding the input source code, passed directly to jsdoc.' 224 | }, 225 | { 226 | optionList: jsdocDefinitions, 227 | }, 228 | { 229 | header: 'dmd', 230 | content: 'These options affect how the markdown output looks.' 231 | }, 232 | { 233 | optionList: definitions, 234 | group: 'dmd', 235 | tableOptions: { 236 | maxWidth: Math.min(process.stdout.columns, 100) 237 | } 238 | }, 239 | { 240 | content: [ 241 | { 242 | col1: 'Project repository:', 243 | col2: '{underline https://github.com/jsdoc2md/jsdoc-to-markdown}' 244 | } 245 | ] 246 | } 247 | ] 248 | } 249 | -------------------------------------------------------------------------------- /lib/dmd-options.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @typicalname options 3 | */ 4 | class DmdOptions { 5 | constructor (options) { 6 | Object.assign(this, options) 7 | this.noCache = options['no-cache'] 8 | delete this['no-cache'] 9 | } 10 | } 11 | 12 | export default DmdOptions 13 | -------------------------------------------------------------------------------- /lib/jsdoc-options.js: -------------------------------------------------------------------------------- 1 | class JsdocOptions { 2 | constructor (options) { 3 | Object.assign(this, options) 4 | this.cache = !options['no-cache'] 5 | delete this['no-cache'] 6 | /* Remove the dmd `template` option - it will break jsdoc-api if passed in as the `template` option must be a filename */ 7 | delete this.template 8 | } 9 | } 10 | 11 | export default JsdocOptions 12 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsdoc-to-markdown", 3 | "version": "9.1.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "jsdoc-to-markdown", 9 | "version": "9.1.1", 10 | "license": "MIT", 11 | "dependencies": { 12 | "array-back": "^6.2.2", 13 | "command-line-args": "^6.0.1", 14 | "command-line-usage": "^7.0.3", 15 | "config-master": "^3.1.0", 16 | "dmd": "^7.1.1", 17 | "jsdoc-api": "^9.3.4", 18 | "jsdoc-parse": "^6.2.4", 19 | "walk-back": "^5.1.1" 20 | }, 21 | "bin": { 22 | "jsdoc2md": "bin/cli.js" 23 | }, 24 | "engines": { 25 | "node": ">=12.17" 26 | }, 27 | "peerDependencies": { 28 | "@75lb/nature": "latest" 29 | }, 30 | "peerDependenciesMeta": { 31 | "@75lb/nature": { 32 | "optional": true 33 | } 34 | } 35 | }, 36 | "node_modules/@babel/helper-string-parser": { 37 | "version": "7.25.9", 38 | "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", 39 | "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", 40 | "license": "MIT", 41 | "engines": { 42 | "node": ">=6.9.0" 43 | } 44 | }, 45 | "node_modules/@babel/helper-validator-identifier": { 46 | "version": "7.25.9", 47 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", 48 | "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", 49 | "license": "MIT", 50 | "engines": { 51 | "node": ">=6.9.0" 52 | } 53 | }, 54 | "node_modules/@babel/parser": { 55 | "version": "7.26.2", 56 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", 57 | "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", 58 | "license": "MIT", 59 | "dependencies": { 60 | "@babel/types": "^7.26.0" 61 | }, 62 | "bin": { 63 | "parser": "bin/babel-parser.js" 64 | }, 65 | "engines": { 66 | "node": ">=6.0.0" 67 | } 68 | }, 69 | "node_modules/@babel/types": { 70 | "version": "7.26.0", 71 | "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", 72 | "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", 73 | "license": "MIT", 74 | "dependencies": { 75 | "@babel/helper-string-parser": "^7.25.9", 76 | "@babel/helper-validator-identifier": "^7.25.9" 77 | }, 78 | "engines": { 79 | "node": ">=6.9.0" 80 | } 81 | }, 82 | "node_modules/@jsdoc/salty": { 83 | "version": "0.2.8", 84 | "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.8.tgz", 85 | "integrity": "sha512-5e+SFVavj1ORKlKaKr2BmTOekmXbelU7dC0cDkQLqag7xfuTPuGMUFx7KWJuv4bYZrTsoL2Z18VVCOKYxzoHcg==", 86 | "license": "Apache-2.0", 87 | "dependencies": { 88 | "lodash": "^4.17.21" 89 | }, 90 | "engines": { 91 | "node": ">=v12.0.0" 92 | } 93 | }, 94 | "node_modules/@nodelib/fs.scandir": { 95 | "version": "2.1.5", 96 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 97 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 98 | "license": "MIT", 99 | "dependencies": { 100 | "@nodelib/fs.stat": "2.0.5", 101 | "run-parallel": "^1.1.9" 102 | }, 103 | "engines": { 104 | "node": ">= 8" 105 | } 106 | }, 107 | "node_modules/@nodelib/fs.stat": { 108 | "version": "2.0.5", 109 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 110 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 111 | "license": "MIT", 112 | "engines": { 113 | "node": ">= 8" 114 | } 115 | }, 116 | "node_modules/@nodelib/fs.walk": { 117 | "version": "1.2.8", 118 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 119 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 120 | "license": "MIT", 121 | "dependencies": { 122 | "@nodelib/fs.scandir": "2.1.5", 123 | "fastq": "^1.6.0" 124 | }, 125 | "engines": { 126 | "node": ">= 8" 127 | } 128 | }, 129 | "node_modules/@types/linkify-it": { 130 | "version": "5.0.0", 131 | "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", 132 | "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", 133 | "license": "MIT" 134 | }, 135 | "node_modules/@types/markdown-it": { 136 | "version": "14.1.2", 137 | "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", 138 | "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", 139 | "license": "MIT", 140 | "dependencies": { 141 | "@types/linkify-it": "^5", 142 | "@types/mdurl": "^2" 143 | } 144 | }, 145 | "node_modules/@types/mdurl": { 146 | "version": "2.0.0", 147 | "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", 148 | "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", 149 | "license": "MIT" 150 | }, 151 | "node_modules/ansi-styles": { 152 | "version": "4.3.0", 153 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 154 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 155 | "license": "MIT", 156 | "dependencies": { 157 | "color-convert": "^2.0.1" 158 | }, 159 | "engines": { 160 | "node": ">=8" 161 | }, 162 | "funding": { 163 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 164 | } 165 | }, 166 | "node_modules/argparse": { 167 | "version": "2.0.1", 168 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 169 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 170 | "license": "Python-2.0" 171 | }, 172 | "node_modules/array-back": { 173 | "version": "6.2.2", 174 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", 175 | "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", 176 | "license": "MIT", 177 | "engines": { 178 | "node": ">=12.17" 179 | } 180 | }, 181 | "node_modules/bluebird": { 182 | "version": "3.7.2", 183 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", 184 | "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", 185 | "license": "MIT" 186 | }, 187 | "node_modules/braces": { 188 | "version": "3.0.3", 189 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 190 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 191 | "license": "MIT", 192 | "dependencies": { 193 | "fill-range": "^7.1.1" 194 | }, 195 | "engines": { 196 | "node": ">=8" 197 | } 198 | }, 199 | "node_modules/cache-point": { 200 | "version": "3.0.0", 201 | "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-3.0.0.tgz", 202 | "integrity": "sha512-LDGNWYv/tqRWAAZxMy75PIYynaIuhcyoyjJtwA7X5uMZjdzvGm+XmTey/GXUy2EJ+lwc2eBFzFYxjvNYyE/0Iw==", 203 | "license": "MIT", 204 | "dependencies": { 205 | "array-back": "^6.2.2" 206 | }, 207 | "engines": { 208 | "node": ">=12.17" 209 | }, 210 | "peerDependencies": { 211 | "@75lb/nature": "^0.1.1" 212 | }, 213 | "peerDependenciesMeta": { 214 | "@75lb/nature": { 215 | "optional": true 216 | } 217 | } 218 | }, 219 | "node_modules/catharsis": { 220 | "version": "0.9.0", 221 | "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", 222 | "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", 223 | "license": "MIT", 224 | "dependencies": { 225 | "lodash": "^4.17.15" 226 | }, 227 | "engines": { 228 | "node": ">= 10" 229 | } 230 | }, 231 | "node_modules/chalk": { 232 | "version": "4.1.2", 233 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 234 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 235 | "license": "MIT", 236 | "dependencies": { 237 | "ansi-styles": "^4.1.0", 238 | "supports-color": "^7.1.0" 239 | }, 240 | "engines": { 241 | "node": ">=10" 242 | }, 243 | "funding": { 244 | "url": "https://github.com/chalk/chalk?sponsor=1" 245 | } 246 | }, 247 | "node_modules/chalk-template": { 248 | "version": "0.4.0", 249 | "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", 250 | "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", 251 | "license": "MIT", 252 | "dependencies": { 253 | "chalk": "^4.1.2" 254 | }, 255 | "engines": { 256 | "node": ">=12" 257 | }, 258 | "funding": { 259 | "url": "https://github.com/chalk/chalk-template?sponsor=1" 260 | } 261 | }, 262 | "node_modules/color-convert": { 263 | "version": "2.0.1", 264 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 265 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 266 | "license": "MIT", 267 | "dependencies": { 268 | "color-name": "~1.1.4" 269 | }, 270 | "engines": { 271 | "node": ">=7.0.0" 272 | } 273 | }, 274 | "node_modules/color-name": { 275 | "version": "1.1.4", 276 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 277 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 278 | "license": "MIT" 279 | }, 280 | "node_modules/command-line-args": { 281 | "version": "6.0.1", 282 | "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-6.0.1.tgz", 283 | "integrity": "sha512-Jr3eByUjqyK0qd8W0SGFW1nZwqCaNCtbXjRo2cRJC1OYxWl3MZ5t1US3jq+cO4sPavqgw4l9BMGX0CBe+trepg==", 284 | "license": "MIT", 285 | "dependencies": { 286 | "array-back": "^6.2.2", 287 | "find-replace": "^5.0.2", 288 | "lodash.camelcase": "^4.3.0", 289 | "typical": "^7.2.0" 290 | }, 291 | "engines": { 292 | "node": ">=12.20" 293 | }, 294 | "peerDependencies": { 295 | "@75lb/nature": "latest" 296 | }, 297 | "peerDependenciesMeta": { 298 | "@75lb/nature": { 299 | "optional": true 300 | } 301 | } 302 | }, 303 | "node_modules/command-line-usage": { 304 | "version": "7.0.3", 305 | "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", 306 | "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", 307 | "license": "MIT", 308 | "dependencies": { 309 | "array-back": "^6.2.2", 310 | "chalk-template": "^0.4.0", 311 | "table-layout": "^4.1.0", 312 | "typical": "^7.1.1" 313 | }, 314 | "engines": { 315 | "node": ">=12.20.0" 316 | } 317 | }, 318 | "node_modules/common-sequence": { 319 | "version": "3.0.0", 320 | "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-3.0.0.tgz", 321 | "integrity": "sha512-g/CgSYk93y+a1IKm50tKl7kaT/OjjTYVQlEbUlt/49ZLV1mcKpUU7iyDiqTAeLdb4QDtQfq3ako8y8v//fzrWQ==", 322 | "license": "MIT", 323 | "engines": { 324 | "node": ">=12.17" 325 | } 326 | }, 327 | "node_modules/config-master": { 328 | "version": "3.1.0", 329 | "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", 330 | "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", 331 | "license": "MIT", 332 | "dependencies": { 333 | "walk-back": "^2.0.1" 334 | } 335 | }, 336 | "node_modules/config-master/node_modules/walk-back": { 337 | "version": "2.0.1", 338 | "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", 339 | "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", 340 | "license": "MIT", 341 | "engines": { 342 | "node": ">=0.10.0" 343 | } 344 | }, 345 | "node_modules/current-module-paths": { 346 | "version": "1.1.2", 347 | "resolved": "https://registry.npmjs.org/current-module-paths/-/current-module-paths-1.1.2.tgz", 348 | "integrity": "sha512-H4s4arcLx/ugbu1XkkgSvcUZax0L6tXUqnppGniQb8l5VjUKGHoayXE5RiriiPhYDd+kjZnaok1Uig13PKtKYQ==", 349 | "license": "MIT", 350 | "engines": { 351 | "node": ">=12.17" 352 | } 353 | }, 354 | "node_modules/dmd": { 355 | "version": "7.1.1", 356 | "resolved": "https://registry.npmjs.org/dmd/-/dmd-7.1.1.tgz", 357 | "integrity": "sha512-Ap2HP6iuOek7eShReDLr9jluNJm9RMZESlt29H/Xs1qrVMkcS9X6m5h1mBC56WMxNiSo0wvjGICmZlYUSFjwZQ==", 358 | "license": "MIT", 359 | "dependencies": { 360 | "array-back": "^6.2.2", 361 | "cache-point": "^3.0.0", 362 | "common-sequence": "^3.0.0", 363 | "file-set": "^5.2.2", 364 | "handlebars": "^4.7.8", 365 | "marked": "^4.3.0", 366 | "walk-back": "^5.1.1" 367 | }, 368 | "engines": { 369 | "node": ">=12.17" 370 | }, 371 | "peerDependencies": { 372 | "@75lb/nature": "latest" 373 | }, 374 | "peerDependenciesMeta": { 375 | "@75lb/nature": { 376 | "optional": true 377 | } 378 | } 379 | }, 380 | "node_modules/entities": { 381 | "version": "4.5.0", 382 | "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", 383 | "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", 384 | "license": "BSD-2-Clause", 385 | "engines": { 386 | "node": ">=0.12" 387 | }, 388 | "funding": { 389 | "url": "https://github.com/fb55/entities?sponsor=1" 390 | } 391 | }, 392 | "node_modules/escape-string-regexp": { 393 | "version": "2.0.0", 394 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", 395 | "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", 396 | "license": "MIT", 397 | "engines": { 398 | "node": ">=8" 399 | } 400 | }, 401 | "node_modules/fast-glob": { 402 | "version": "3.3.2", 403 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", 404 | "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", 405 | "license": "MIT", 406 | "dependencies": { 407 | "@nodelib/fs.stat": "^2.0.2", 408 | "@nodelib/fs.walk": "^1.2.3", 409 | "glob-parent": "^5.1.2", 410 | "merge2": "^1.3.0", 411 | "micromatch": "^4.0.4" 412 | }, 413 | "engines": { 414 | "node": ">=8.6.0" 415 | } 416 | }, 417 | "node_modules/fastq": { 418 | "version": "1.17.1", 419 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", 420 | "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", 421 | "license": "ISC", 422 | "dependencies": { 423 | "reusify": "^1.0.4" 424 | } 425 | }, 426 | "node_modules/file-set": { 427 | "version": "5.2.2", 428 | "resolved": "https://registry.npmjs.org/file-set/-/file-set-5.2.2.tgz", 429 | "integrity": "sha512-/KgJI1V/QaDK4enOk/E2xMFk1cTWJghEr7UmWiRZfZ6upt6gQCfMn4jJ7aOm64OKurj4TaVnSSgSDqv5ZKYA3A==", 430 | "license": "MIT", 431 | "dependencies": { 432 | "array-back": "^6.2.2", 433 | "fast-glob": "^3.3.2" 434 | }, 435 | "engines": { 436 | "node": ">=12.17" 437 | }, 438 | "peerDependencies": { 439 | "@75lb/nature": "latest" 440 | }, 441 | "peerDependenciesMeta": { 442 | "@75lb/nature": { 443 | "optional": true 444 | } 445 | } 446 | }, 447 | "node_modules/fill-range": { 448 | "version": "7.1.1", 449 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 450 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 451 | "license": "MIT", 452 | "dependencies": { 453 | "to-regex-range": "^5.0.1" 454 | }, 455 | "engines": { 456 | "node": ">=8" 457 | } 458 | }, 459 | "node_modules/find-replace": { 460 | "version": "5.0.2", 461 | "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-5.0.2.tgz", 462 | "integrity": "sha512-Y45BAiE3mz2QsrN2fb5QEtO4qb44NcS7en/0y9PEVsg351HsLeVclP8QPMH79Le9sH3rs5RSwJu99W0WPZO43Q==", 463 | "license": "MIT", 464 | "engines": { 465 | "node": ">=14" 466 | }, 467 | "peerDependencies": { 468 | "@75lb/nature": "latest" 469 | }, 470 | "peerDependenciesMeta": { 471 | "@75lb/nature": { 472 | "optional": true 473 | } 474 | } 475 | }, 476 | "node_modules/glob-parent": { 477 | "version": "5.1.2", 478 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 479 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 480 | "license": "ISC", 481 | "dependencies": { 482 | "is-glob": "^4.0.1" 483 | }, 484 | "engines": { 485 | "node": ">= 6" 486 | } 487 | }, 488 | "node_modules/graceful-fs": { 489 | "version": "4.2.11", 490 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 491 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", 492 | "license": "ISC" 493 | }, 494 | "node_modules/handlebars": { 495 | "version": "4.7.8", 496 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", 497 | "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", 498 | "license": "MIT", 499 | "dependencies": { 500 | "minimist": "^1.2.5", 501 | "neo-async": "^2.6.2", 502 | "source-map": "^0.6.1", 503 | "wordwrap": "^1.0.0" 504 | }, 505 | "bin": { 506 | "handlebars": "bin/handlebars" 507 | }, 508 | "engines": { 509 | "node": ">=0.4.7" 510 | }, 511 | "optionalDependencies": { 512 | "uglify-js": "^3.1.4" 513 | } 514 | }, 515 | "node_modules/has-flag": { 516 | "version": "4.0.0", 517 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 518 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 519 | "license": "MIT", 520 | "engines": { 521 | "node": ">=8" 522 | } 523 | }, 524 | "node_modules/is-extglob": { 525 | "version": "2.1.1", 526 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 527 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 528 | "license": "MIT", 529 | "engines": { 530 | "node": ">=0.10.0" 531 | } 532 | }, 533 | "node_modules/is-glob": { 534 | "version": "4.0.3", 535 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 536 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 537 | "license": "MIT", 538 | "dependencies": { 539 | "is-extglob": "^2.1.1" 540 | }, 541 | "engines": { 542 | "node": ">=0.10.0" 543 | } 544 | }, 545 | "node_modules/is-number": { 546 | "version": "7.0.0", 547 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 548 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 549 | "license": "MIT", 550 | "engines": { 551 | "node": ">=0.12.0" 552 | } 553 | }, 554 | "node_modules/js2xmlparser": { 555 | "version": "4.0.2", 556 | "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", 557 | "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", 558 | "license": "Apache-2.0", 559 | "dependencies": { 560 | "xmlcreate": "^2.0.4" 561 | } 562 | }, 563 | "node_modules/jsdoc": { 564 | "version": "4.0.4", 565 | "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.4.tgz", 566 | "integrity": "sha512-zeFezwyXeG4syyYHbvh1A967IAqq/67yXtXvuL5wnqCkFZe8I0vKfm+EO+YEvLguo6w9CDUbrAXVtJSHh2E8rw==", 567 | "license": "Apache-2.0", 568 | "dependencies": { 569 | "@babel/parser": "^7.20.15", 570 | "@jsdoc/salty": "^0.2.1", 571 | "@types/markdown-it": "^14.1.1", 572 | "bluebird": "^3.7.2", 573 | "catharsis": "^0.9.0", 574 | "escape-string-regexp": "^2.0.0", 575 | "js2xmlparser": "^4.0.2", 576 | "klaw": "^3.0.0", 577 | "markdown-it": "^14.1.0", 578 | "markdown-it-anchor": "^8.6.7", 579 | "marked": "^4.0.10", 580 | "mkdirp": "^1.0.4", 581 | "requizzle": "^0.2.3", 582 | "strip-json-comments": "^3.1.0", 583 | "underscore": "~1.13.2" 584 | }, 585 | "bin": { 586 | "jsdoc": "jsdoc.js" 587 | }, 588 | "engines": { 589 | "node": ">=12.0.0" 590 | } 591 | }, 592 | "node_modules/jsdoc-api": { 593 | "version": "9.3.4", 594 | "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-9.3.4.tgz", 595 | "integrity": "sha512-di8lggLACEttpyAZ6WjKKafUP4wC4prAGjt40nMl7quDpp2nD7GmLt6/WxhRu9Q6IYoAAySsNeidBXYVAMwlqg==", 596 | "license": "MIT", 597 | "dependencies": { 598 | "array-back": "^6.2.2", 599 | "cache-point": "^3.0.0", 600 | "current-module-paths": "^1.1.2", 601 | "file-set": "^5.2.2", 602 | "jsdoc": "^4.0.4", 603 | "object-to-spawn-args": "^2.0.1", 604 | "walk-back": "^5.1.1" 605 | }, 606 | "engines": { 607 | "node": ">=12.17" 608 | }, 609 | "peerDependencies": { 610 | "@75lb/nature": "latest" 611 | }, 612 | "peerDependenciesMeta": { 613 | "@75lb/nature": { 614 | "optional": true 615 | } 616 | } 617 | }, 618 | "node_modules/jsdoc-parse": { 619 | "version": "6.2.4", 620 | "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.4.tgz", 621 | "integrity": "sha512-MQA+lCe3ioZd0uGbyB3nDCDZcKgKC7m/Ivt0LgKZdUoOlMJxUWJQ3WI6GeyHp9ouznKaCjlp7CU9sw5k46yZTw==", 622 | "license": "MIT", 623 | "dependencies": { 624 | "array-back": "^6.2.2", 625 | "find-replace": "^5.0.1", 626 | "lodash.omit": "^4.5.0", 627 | "sort-array": "^5.0.0" 628 | }, 629 | "engines": { 630 | "node": ">=12" 631 | } 632 | }, 633 | "node_modules/klaw": { 634 | "version": "3.0.0", 635 | "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", 636 | "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", 637 | "license": "MIT", 638 | "dependencies": { 639 | "graceful-fs": "^4.1.9" 640 | } 641 | }, 642 | "node_modules/linkify-it": { 643 | "version": "5.0.0", 644 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", 645 | "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", 646 | "license": "MIT", 647 | "dependencies": { 648 | "uc.micro": "^2.0.0" 649 | } 650 | }, 651 | "node_modules/lodash": { 652 | "version": "4.17.21", 653 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 654 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 655 | "license": "MIT" 656 | }, 657 | "node_modules/lodash.camelcase": { 658 | "version": "4.3.0", 659 | "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", 660 | "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", 661 | "license": "MIT" 662 | }, 663 | "node_modules/lodash.omit": { 664 | "version": "4.5.0", 665 | "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", 666 | "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", 667 | "license": "MIT" 668 | }, 669 | "node_modules/markdown-it": { 670 | "version": "14.1.0", 671 | "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", 672 | "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", 673 | "license": "MIT", 674 | "dependencies": { 675 | "argparse": "^2.0.1", 676 | "entities": "^4.4.0", 677 | "linkify-it": "^5.0.0", 678 | "mdurl": "^2.0.0", 679 | "punycode.js": "^2.3.1", 680 | "uc.micro": "^2.1.0" 681 | }, 682 | "bin": { 683 | "markdown-it": "bin/markdown-it.mjs" 684 | } 685 | }, 686 | "node_modules/markdown-it-anchor": { 687 | "version": "8.6.7", 688 | "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", 689 | "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", 690 | "license": "Unlicense", 691 | "peerDependencies": { 692 | "@types/markdown-it": "*", 693 | "markdown-it": "*" 694 | } 695 | }, 696 | "node_modules/marked": { 697 | "version": "4.3.0", 698 | "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", 699 | "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", 700 | "license": "MIT", 701 | "bin": { 702 | "marked": "bin/marked.js" 703 | }, 704 | "engines": { 705 | "node": ">= 12" 706 | } 707 | }, 708 | "node_modules/mdurl": { 709 | "version": "2.0.0", 710 | "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", 711 | "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", 712 | "license": "MIT" 713 | }, 714 | "node_modules/merge2": { 715 | "version": "1.4.1", 716 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", 717 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", 718 | "license": "MIT", 719 | "engines": { 720 | "node": ">= 8" 721 | } 722 | }, 723 | "node_modules/micromatch": { 724 | "version": "4.0.8", 725 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", 726 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", 727 | "license": "MIT", 728 | "dependencies": { 729 | "braces": "^3.0.3", 730 | "picomatch": "^2.3.1" 731 | }, 732 | "engines": { 733 | "node": ">=8.6" 734 | } 735 | }, 736 | "node_modules/minimist": { 737 | "version": "1.2.8", 738 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 739 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 740 | "license": "MIT", 741 | "funding": { 742 | "url": "https://github.com/sponsors/ljharb" 743 | } 744 | }, 745 | "node_modules/mkdirp": { 746 | "version": "1.0.4", 747 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", 748 | "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", 749 | "license": "MIT", 750 | "bin": { 751 | "mkdirp": "bin/cmd.js" 752 | }, 753 | "engines": { 754 | "node": ">=10" 755 | } 756 | }, 757 | "node_modules/neo-async": { 758 | "version": "2.6.2", 759 | "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", 760 | "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", 761 | "license": "MIT" 762 | }, 763 | "node_modules/object-to-spawn-args": { 764 | "version": "2.0.1", 765 | "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", 766 | "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", 767 | "license": "MIT", 768 | "engines": { 769 | "node": ">=8.0.0" 770 | } 771 | }, 772 | "node_modules/picomatch": { 773 | "version": "2.3.1", 774 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 775 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 776 | "license": "MIT", 777 | "engines": { 778 | "node": ">=8.6" 779 | }, 780 | "funding": { 781 | "url": "https://github.com/sponsors/jonschlinkert" 782 | } 783 | }, 784 | "node_modules/punycode.js": { 785 | "version": "2.3.1", 786 | "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", 787 | "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", 788 | "license": "MIT", 789 | "engines": { 790 | "node": ">=6" 791 | } 792 | }, 793 | "node_modules/queue-microtask": { 794 | "version": "1.2.3", 795 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 796 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 797 | "funding": [ 798 | { 799 | "type": "github", 800 | "url": "https://github.com/sponsors/feross" 801 | }, 802 | { 803 | "type": "patreon", 804 | "url": "https://www.patreon.com/feross" 805 | }, 806 | { 807 | "type": "consulting", 808 | "url": "https://feross.org/support" 809 | } 810 | ], 811 | "license": "MIT" 812 | }, 813 | "node_modules/requizzle": { 814 | "version": "0.2.4", 815 | "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", 816 | "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", 817 | "license": "MIT", 818 | "dependencies": { 819 | "lodash": "^4.17.21" 820 | } 821 | }, 822 | "node_modules/reusify": { 823 | "version": "1.0.4", 824 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 825 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 826 | "license": "MIT", 827 | "engines": { 828 | "iojs": ">=1.0.0", 829 | "node": ">=0.10.0" 830 | } 831 | }, 832 | "node_modules/run-parallel": { 833 | "version": "1.2.0", 834 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 835 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 836 | "funding": [ 837 | { 838 | "type": "github", 839 | "url": "https://github.com/sponsors/feross" 840 | }, 841 | { 842 | "type": "patreon", 843 | "url": "https://www.patreon.com/feross" 844 | }, 845 | { 846 | "type": "consulting", 847 | "url": "https://feross.org/support" 848 | } 849 | ], 850 | "license": "MIT", 851 | "dependencies": { 852 | "queue-microtask": "^1.2.2" 853 | } 854 | }, 855 | "node_modules/sort-array": { 856 | "version": "5.0.0", 857 | "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-5.0.0.tgz", 858 | "integrity": "sha512-Sg9MzajSGprcSrMIxsXyNT0e0JB47RJRfJspC+7co4Z5BdNsNl8FmWI+lXEpyKq+vkMG6pHgAhqyCO+bkDTfFQ==", 859 | "license": "MIT", 860 | "dependencies": { 861 | "array-back": "^6.2.2", 862 | "typical": "^7.1.1" 863 | }, 864 | "engines": { 865 | "node": ">=12.17" 866 | }, 867 | "peerDependencies": { 868 | "@75lb/nature": "^0.1.1" 869 | }, 870 | "peerDependenciesMeta": { 871 | "@75lb/nature": { 872 | "optional": true 873 | } 874 | } 875 | }, 876 | "node_modules/source-map": { 877 | "version": "0.6.1", 878 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 879 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 880 | "license": "BSD-3-Clause", 881 | "engines": { 882 | "node": ">=0.10.0" 883 | } 884 | }, 885 | "node_modules/strip-json-comments": { 886 | "version": "3.1.1", 887 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 888 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 889 | "license": "MIT", 890 | "engines": { 891 | "node": ">=8" 892 | }, 893 | "funding": { 894 | "url": "https://github.com/sponsors/sindresorhus" 895 | } 896 | }, 897 | "node_modules/supports-color": { 898 | "version": "7.2.0", 899 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 900 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 901 | "license": "MIT", 902 | "dependencies": { 903 | "has-flag": "^4.0.0" 904 | }, 905 | "engines": { 906 | "node": ">=8" 907 | } 908 | }, 909 | "node_modules/table-layout": { 910 | "version": "4.1.1", 911 | "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", 912 | "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", 913 | "license": "MIT", 914 | "dependencies": { 915 | "array-back": "^6.2.2", 916 | "wordwrapjs": "^5.1.0" 917 | }, 918 | "engines": { 919 | "node": ">=12.17" 920 | } 921 | }, 922 | "node_modules/to-regex-range": { 923 | "version": "5.0.1", 924 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 925 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 926 | "license": "MIT", 927 | "dependencies": { 928 | "is-number": "^7.0.0" 929 | }, 930 | "engines": { 931 | "node": ">=8.0" 932 | } 933 | }, 934 | "node_modules/typical": { 935 | "version": "7.3.0", 936 | "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", 937 | "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", 938 | "license": "MIT", 939 | "engines": { 940 | "node": ">=12.17" 941 | } 942 | }, 943 | "node_modules/uc.micro": { 944 | "version": "2.1.0", 945 | "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", 946 | "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", 947 | "license": "MIT" 948 | }, 949 | "node_modules/uglify-js": { 950 | "version": "3.19.3", 951 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", 952 | "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", 953 | "license": "BSD-2-Clause", 954 | "optional": true, 955 | "bin": { 956 | "uglifyjs": "bin/uglifyjs" 957 | }, 958 | "engines": { 959 | "node": ">=0.8.0" 960 | } 961 | }, 962 | "node_modules/underscore": { 963 | "version": "1.13.7", 964 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", 965 | "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", 966 | "license": "MIT" 967 | }, 968 | "node_modules/walk-back": { 969 | "version": "5.1.1", 970 | "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.1.tgz", 971 | "integrity": "sha512-e/FRLDVdZQWFrAzU6Hdvpm7D7m2ina833gIKLptQykRK49mmCYHLHq7UqjPDbxbKLZkTkW1rFqbengdE3sLfdw==", 972 | "license": "MIT", 973 | "engines": { 974 | "node": ">=12.17" 975 | } 976 | }, 977 | "node_modules/wordwrap": { 978 | "version": "1.0.0", 979 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 980 | "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", 981 | "license": "MIT" 982 | }, 983 | "node_modules/wordwrapjs": { 984 | "version": "5.1.0", 985 | "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", 986 | "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", 987 | "license": "MIT", 988 | "engines": { 989 | "node": ">=12.17" 990 | } 991 | }, 992 | "node_modules/xmlcreate": { 993 | "version": "2.0.4", 994 | "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", 995 | "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", 996 | "license": "Apache-2.0" 997 | } 998 | } 999 | } 1000 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsdoc-to-markdown", 3 | "author": "Lloyd Brookes", 4 | "version": "9.1.1", 5 | "description": "Generates markdown API documentation from jsdoc annotated source code", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/jsdoc2md/jsdoc-to-markdown.git" 9 | }, 10 | "bin": { 11 | "jsdoc2md": "bin/cli.js" 12 | }, 13 | "engines": { 14 | "node": ">=12.17" 15 | }, 16 | "type": "module", 17 | "exports": { 18 | "import": "./index.js", 19 | "require": "./dist/index.cjs" 20 | }, 21 | "license": "MIT", 22 | "scripts": { 23 | "test": "npm run dist && npm run test:ci", 24 | "test:ci": "75lb-nature test-runner test/async.js test/cli.js", 25 | "docs": "node bin/cli.js --heading-depth 1 index.js > docs/API.md", 26 | "dist": "75lb-nature cjs-build index.js" 27 | }, 28 | "keywords": [ 29 | "jsdoc", 30 | "markdown", 31 | "api", 32 | "generator", 33 | "javascript", 34 | "js", 35 | "documentation" 36 | ], 37 | "dependencies": { 38 | "array-back": "^6.2.2", 39 | "command-line-args": "^6.0.1", 40 | "command-line-usage": "^7.0.3", 41 | "config-master": "^3.1.0", 42 | "dmd": "^7.1.1", 43 | "jsdoc-api": "^9.3.4", 44 | "jsdoc-parse": "^6.2.4", 45 | "walk-back": "^5.1.1" 46 | }, 47 | "peerDependencies": { 48 | "@75lb/nature": "latest" 49 | }, 50 | "peerDependenciesMeta": { 51 | "@75lb/nature": { 52 | "optional": true 53 | } 54 | }, 55 | "standard": { 56 | "ignore": [ 57 | "test/fixture" 58 | ] 59 | }, 60 | "files": [ 61 | "index.js", 62 | "bin", 63 | "lib", 64 | "dist" 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /test/async.js: -------------------------------------------------------------------------------- 1 | import { strict as a } from 'assert' 2 | import jsdoc2md from 'jsdoc-to-markdown' 3 | 4 | const [test, only, skip] = [new Map(), new Map(), new Map()] 5 | const inputFile = 'test/fixture/ignore.js' 6 | 7 | test.set('.render({ files })', function () { 8 | return jsdoc2md.render({ files: inputFile }) 9 | .then(result => a.ok(/a visible global/.test(result))) 10 | }) 11 | 12 | test.set('.render({ data })', function () { 13 | const data = [ 14 | { 15 | id: 'visible', 16 | longname: 'visible', 17 | name: 'visible', 18 | kind: 'member', 19 | scope: 'global', 20 | description: 'a visible global', 21 | meta: { 22 | lineno: 4, 23 | filename: 'ignore.js' 24 | }, 25 | order: 0 26 | }, 27 | { 28 | id: 'invisible', 29 | longname: 'invisible', 30 | name: 'invisible', 31 | kind: 'member', 32 | scope: 'global', 33 | description: 'an ignored global', 34 | ignore: true, 35 | meta: { 36 | lineno: 10, 37 | filename: 'ignore.js' 38 | }, 39 | order: 1 40 | } 41 | ] 42 | return jsdoc2md.render({ data: data }) 43 | .then(result => a.ok(/a visible global/.test(result))) 44 | }) 45 | 46 | test.set('.render({ files, heading-depth: 4 })', function () { 47 | return jsdoc2md.render({ files: inputFile, 'heading-depth': 4 }) 48 | .then(result => a.ok(/#### visible/.test(result))) 49 | }) 50 | 51 | test.set('.render({ files, param-list-format: list })', function () { 52 | const inputFile = 'test/fixture/params.js' 53 | return jsdoc2md.render({ files: inputFile, 'param-list-format': 'list' }) 54 | .then(result => a.ok(/- one/.test(result))) 55 | }) 56 | 57 | test.set('.getTemplateData({ files })', function () { 58 | return jsdoc2md.getTemplateData({ files: inputFile }) 59 | .then(result => a.ok(result[0].id)) 60 | }) 61 | 62 | test.set('.getJsdocData({ files })', function () { 63 | return jsdoc2md.getJsdocData({ files: inputFile }) 64 | .then(result => a.ok(result[0].longname)) 65 | }) 66 | 67 | test.set('.render({ files, noCache })', function () { 68 | return jsdoc2md.render({ files: inputFile, noCache: true }) 69 | .then(result => a.ok(/a visible global/.test(result))) 70 | }) 71 | 72 | test.set('.render({ data, noCache })', function () { 73 | const data = [ 74 | { 75 | id: 'visible', 76 | longname: 'visible', 77 | name: 'visible', 78 | kind: 'member', 79 | scope: 'global', 80 | description: 'a visible global', 81 | meta: { 82 | lineno: 4, 83 | filename: 'ignore.js' 84 | }, 85 | order: 0 86 | }, 87 | { 88 | id: 'invisible', 89 | longname: 'invisible', 90 | name: 'invisible', 91 | kind: 'member', 92 | scope: 'global', 93 | description: 'an ignored global', 94 | ignore: true, 95 | meta: { 96 | lineno: 10, 97 | filename: 'ignore.js' 98 | }, 99 | order: 1 100 | } 101 | ] 102 | return jsdoc2md.render({ data: data, noCache: true }) 103 | .then(result => a.ok(/a visible global/.test(result))) 104 | }) 105 | 106 | test.set('.render({ files, heading-depth: 4, noCache })', function () { 107 | return jsdoc2md.render({ files: inputFile, 'heading-depth': 4, noCache: true }) 108 | .then(result => a.ok(/#### visible/.test(result))) 109 | }) 110 | 111 | test.set('.render({ files, param-list-format: list, noCache })', function () { 112 | const inputFile = 'test/fixture/params.js' 113 | return jsdoc2md.render({ files: inputFile, 'param-list-format': 'list', noCache: true }) 114 | .then(result => a.ok(/- one/.test(result))) 115 | }) 116 | 117 | test.set('.getTemplateData({ files, noCache })', function () { 118 | return jsdoc2md.getTemplateData({ files: inputFile, noCache: true }) 119 | .then(result => a.ok(result[0].id)) 120 | }) 121 | 122 | test.set('.getJsdocData({ files, noCache })', function () { 123 | return jsdoc2md.getJsdocData({ files: inputFile, noCache: true }) 124 | .then(result => a.ok(result[0].longname)) 125 | }) 126 | 127 | test.set('.getNamepaths()', function () { 128 | return jsdoc2md.getNamepaths({ files: 'test/fixture/ignore.js' }) 129 | .then(namepaths => { 130 | a.deepStrictEqual(namepaths.member, [ 131 | 'visible', 132 | 'invisible' 133 | ]) 134 | }) 135 | }) 136 | 137 | test.set('.clear()', function () { 138 | return jsdoc2md.clear() 139 | }) 140 | 141 | test.set('.render({ files, send })', function () { 142 | return jsdoc2md.render({ files: inputFile, send: true }) 143 | .then(result => a.ok(/a visible global/.test(result))) 144 | }) 145 | 146 | export { test, only, skip } 147 | 148 | -------------------------------------------------------------------------------- /test/cli.js: -------------------------------------------------------------------------------- 1 | import { strict as a } from 'assert' 2 | import fs from 'node:fs' 3 | import { spawn } from 'node:child_process' 4 | 5 | const [test, only, skip] = [new Map(), new Map(), new Map()] 6 | const inputPath = 'test/fixture/ignore.js' 7 | 8 | try { 9 | fs.mkdirSync('tmp-test') 10 | } catch (err) { 11 | // dir exists 12 | } 13 | 14 | test.set('cli: json option', async function () { 15 | const outputFile = fs.openSync('tmp-test/ignore.json', 'w') 16 | return new Promise((resolve, reject) => { 17 | const handle = spawn( 18 | 'node', 19 | ['bin/cli.js', '--no-cache', '--json', inputPath], 20 | { stdio: ['ignore', outputFile, 'inherit'] } 21 | ) 22 | handle.on('close', function (code) { 23 | if (code !== 0) { 24 | return reject(new Error('CLI process failed')) 25 | } 26 | const json = fs.readFileSync('tmp-test/ignore.json', 'utf8') 27 | if (json) { 28 | a.ok(/"id": "visible"/.test(json.toString())) 29 | resolve() 30 | } else { 31 | reject(new Error('no json returned')) 32 | } 33 | }) 34 | handle.on('error', reject) 35 | }) 36 | }) 37 | 38 | export { test, only, skip } 39 | 40 | -------------------------------------------------------------------------------- /test/fixture/ignore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * a visible global 3 | */ 4 | var visible = true 5 | 6 | /** 7 | * an ignored global 8 | * @ignore 9 | */ 10 | var invisible = true 11 | -------------------------------------------------------------------------------- /test/fixture/params.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {string} 3 | * @param {number} 4 | */ 5 | function func (one, two) {} 6 | --------------------------------------------------------------------------------