{"id":15546892,"url":"https://github.com/jsdoc2md/jsdoc-api","last_synced_at":"2025-05-16T02:08:56.106Z","repository":{"id":54388254,"uuid":"48197470","full_name":"jsdoc2md/jsdoc-api","owner":"jsdoc2md","description":"A programmatic interface for jsdoc3 with a few extra features","archived":false,"fork":false,"pushed_at":"2024-11-01T23:31:00.000Z","size":549,"stargazers_count":65,"open_issues_count":2,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T12:12:27.758Z","etag":null,"topics":["documentation","documentation-tool","javascript","javascript-library","jsdoc","nodejs","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsdoc2md.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-17T20:46:41.000Z","updated_at":"2025-03-21T00:27:14.000Z","dependencies_parsed_at":"2024-12-08T01:03:57.453Z","dependency_job_id":"d21ee356-b686-4695-ac98-ee39fcd6b08f","html_url":"https://github.com/jsdoc2md/jsdoc-api","commit_stats":{"total_commits":204,"total_committers":4,"mean_commits":51.0,"dds":0.02941176470588236,"last_synced_commit":"a3b88ffbd489caf070919fb5421b274328ff7fb2"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdoc2md%2Fjsdoc-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdoc2md%2Fjsdoc-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdoc2md%2Fjsdoc-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdoc2md%2Fjsdoc-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdoc2md","download_url":"https://codeload.github.com/jsdoc2md/jsdoc-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453655,"owners_count":22073617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","documentation-tool","javascript","javascript-library","jsdoc","nodejs","npm-package"],"created_at":"2024-10-02T13:05:16.054Z","updated_at":"2025-05-16T02:08:56.063Z","avatar_url":"https://github.com/jsdoc2md.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\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\u0026copy; 2015-24 [Lloyd Brookes](https://github.com/75lb) \\\u003c75pound@gmail.com\\\u003e.\n\nTested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdoc2md%2Fjsdoc-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdoc2md%2Fjsdoc-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdoc2md%2Fjsdoc-api/lists"}