{"name":"jsdoc-api","version":"9.3.5","keywords":["jsdoc","api","programmatic","interface","javascript","documentation"],"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"license":"MIT","_id":"jsdoc-api@9.3.5","maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"homepage":"https://github.com/jsdoc2md/jsdoc-api#readme","bugs":{"url":"https://github.com/jsdoc2md/jsdoc-api/issues"},"dist":{"shasum":"1f5683b8db9cdc5d8afb606ec0041f3c1b7bbd0f","tarball":"http://registry-npm.ywwl.com/jsdoc-api/download/jsdoc-api-9.3.5.tgz","fileCount":9,"integrity":"sha512-TQwh1jA8xtCkIbVwm/XA3vDRAa5JjydyKx1cC413Sh3WohDFxcMdwKSvn4LOsq2xWyAmOU/VnSChTQf6EF0R8g==","signatures":[{"sig":"MEYCIQDS7g/72iPw3GozSVTmlX6AMr3skQt/XN39WUKuraqZhwIhAKoi0FFBEO2nX2Pb1ANuRTCVYRGAKVPLgzCXKDkRGXkx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30565,"size":7648,"noattachment":false,"key":"/jsdoc-api/-/jsdoc-api-9.3.5.tgz"},"type":"module","engines":{"node":">=12.17"},"exports":{"import":"./index.js","require":"./dist/index.cjs"},"gitHead":"77475d0fa86fc211c52e04fe6b997194db7d4a6d","scripts":{"dist":"75lb-nature cjs-build index.js","docs":"75lb-nature jsdoc2md index.js lib/*.js > docs/api.md","test":"npm run dist && npm run test:ci","test:ci":"75lb-nature test-runner test/caching.js test/explain.js test/render.js"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"standard":{"ignore":["tmp","test/fixture","dist"]},"repository":{"url":"git+https://github.com/jsdoc2md/jsdoc-api.git","type":"git"},"_npmVersion":"11.4.2","description":"A programmatic interface for jsdoc","directories":{},"_nodeVersion":"24.4.1","dependencies":{"jsdoc":"^4.0.4","file-set":"^5.3.0","walk-back":"^5.1.1","array-back":"^6.2.2","cache-point":"^3.0.1","current-module-paths":"^1.1.2","object-to-spawn-args":"^2.0.1"},"_hasShrinkwrap":false,"peerDependencies":{"@75lb/nature":"latest"},"peerDependenciesMeta":{"@75lb/nature":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/jsdoc-api_9.3.5_1752766661840_0.6186977541957295","host":"s3://npm-registry-packages-npm-production"},"readme":"[![view on npm](https://badgen.net/npm/v/jsdoc-api)](https://www.npmjs.org/package/jsdoc-api)\n[![npm module downloads](https://badgen.net/npm/dt/jsdoc-api)](https://www.npmjs.org/package/jsdoc-api)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/jsdoc2md/jsdoc-api)](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/jsdoc2md/jsdoc-api)](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/jsdoc2md/jsdoc-api/actions/workflows/node.js.yml/badge.svg)](https://github.com/jsdoc2md/jsdoc-api/actions/workflows/node.js.yml)\n\n***Upgraders, please check the [release notes](https://github.com/jsdoc2md/jsdoc-api/releases).***\n\n# jsdoc-api\n\nA programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features:\n\n- Asynchronous 'explain' and 'render documentation' methods (the two main jsdoc operations).\n- Input (source code) can supplied as a string or set of file names and/or globs.\n- Optional caching, dramatically speeding up future invocations with the same input.\n\n## Synopsis\n\nTo output an array of json objects, each representing a doclet, use [.explain()](https://github.com/jsdoc2md/jsdoc-api/blob/master/docs/api.md#module_jsdoc-api--jsdoc.explain). Pass in an array of file names and/or glob expressions. Use the `cache: true` flag for a faster, more efficient invocation (cached output from a prior invocation will be returned if the input has not changed).\n\n```js\nimport jsdoc from 'jsdoc-api'\n\nconst data = await jsdoc.explain({ files: ['index.js', 'lib/*.js'], cache: true })\nconsole.log(data)\n```\n\nTypical output (truncated):\n\n```js\n[\n    {\n        comment: '/**\\n' +\n          '  * The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()`.\\n' +\n          '  * @type {external:cache-point}\\n' +\n          '  */',\n        meta: {\n          range: [ 491, 554 ],\n          filename: 'index.js',\n          lineno: 21,\n          columnno: 6,\n          path: '/Users/lloyd/Documents/jsdoc2md/jsdoc-api',\n          code: { id: 'astnode100000027', name: 'cache', type: 'NewExpression', value: '' }\n        },\n        description: 'The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()`.',\n        type: { names: [ 'external:cache-point' ] },\n        name: 'cache',\n        longname: 'module:jsdoc-api~cache',\n        kind: 'constant',\n        scope: 'inner',\n        memberof: 'module:jsdoc-api',\n        params: []\n    },\n    // etc\n    // etc\n]\n```\n\nAs an alternative to passing in file names/globs (above), you can pass in one or more source code strings.\n\n```js\nimport jsdoc from 'jsdoc-api'\n\nconst data = await jsdoc.explain({ source: '/** example doclet */ \\n var example = true' })\nconsole.log(data)\n```\n\nOutput:\n\n```js\n[\n  {\n    comment: '/** example doclet */',\n    meta: {\n      range: [ 28, 42 ],\n      filename: '934b1fbe2810.js',\n      lineno: 2,\n      columnno: 5,\n      path: '/var/folders/bt/jgn73jf50vsb5gj92dk00v3r0000gn/T/jsdoc-api-W854dk',\n      code: { id: 'astnode100000003', name: 'example', type: 'Literal', value: true }\n    },\n    description: 'example doclet',\n    name: 'example',\n    longname: 'example',\n    kind: 'member',\n    scope: 'global',\n    params: []\n  },\n  { kind: 'package', longname: 'package:undefined', files: [ '/var/folders/bt/jgn73jf50vsb5gj92dk00v3r0000gn/T/jsdoc-api-W854dk/934b1fbe2810.js' ] }\n]\n```\n\nFinally, use the `render()` method to invocate jsdoc directly, generating your documentation.\n\n```js\nimport jsdoc from 'jsdoc-api'\n\nawait jsdoc.render({ files: ['index.js', 'lib/something.js'], destination: 'jsdoc-output' })\n```\n\nIf you need to use a specific `jsdoc` version or fork, specify its path via `JSDOC_PATH` and jsdoc-api will use it instead of the default.\n\n```sh\n$ export JSDOC_PATH=./node_modules/.bin/jsdoc # An alternative jsdoc version you installed\n$ node my-jsdoc-api-script.js                 # Run your jsdoc-api app as usual\n```\n\nSee the [API documentation](https://github.com/jsdoc2md/jsdoc-api/blob/master/docs/api.md) for further details. See the [example folder](https://github.com/jsdoc2md/jsdoc-api/tree/master/example) for code examples.\n\n* * *\n\n&copy; 2015-2026 [Lloyd Brookes](https://github.com/75lb) \\<opensource@75lb.com\\>.\n\nDocumented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1752766662025,"_cnpm_publish_time":1752766662025,"dist-tags":{"latest":"9.3.6","next":"9.0.0-1"}}