{"id":17058281,"url":"https://github.com/garthdb/atomdoc-cli","last_synced_at":"2026-02-08T23:02:47.944Z","repository":{"id":56242366,"uuid":"67436830","full_name":"GarthDB/atomdoc-cli","owner":"GarthDB","description":"A CLI interface for AtomDoc","archived":false,"fork":false,"pushed_at":"2023-01-12T09:07:09.000Z","size":907,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T06:49:02.216Z","etag":null,"topics":["atomdoc","cli","code-analysis","code-quality","documentation-tool"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GarthDB.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}},"created_at":"2016-09-05T16:47:24.000Z","updated_at":"2023-02-13T05:55:42.000Z","dependencies_parsed_at":"2023-02-09T11:01:16.076Z","dependency_job_id":null,"html_url":"https://github.com/GarthDB/atomdoc-cli","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GarthDB%2Fatomdoc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GarthDB%2Fatomdoc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GarthDB%2Fatomdoc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GarthDB%2Fatomdoc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GarthDB","download_url":"https://codeload.github.com/GarthDB/atomdoc-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411232,"owners_count":20934654,"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":["atomdoc","cli","code-analysis","code-quality","documentation-tool"],"created_at":"2024-10-14T10:29:15.955Z","updated_at":"2025-04-05T23:17:29.858Z","avatar_url":"https://github.com/GarthDB.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AtomDoc CLI\n\n[![Build Status](https://travis-ci.org/GarthDB/atomdoc-cli.svg?branch=master)](https://travis-ci.org/GarthDB/atomdoc-cli) [![codecov](https://codecov.io/gh/GarthDB/atomdoc-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/GarthDB/atomdoc-cli) [![Dependency Status](https://david-dm.org/GarthDB/atomdoc-cli.svg)](https://david-dm.org/GarthDB/atomdoc-cli) [![npm version](https://badge.fury.io/js/atomdoc-cli.svg)](https://badge.fury.io/js/atomdoc-cli)\n\n---\n\n![Console Screenshot](http://garthdb.com/atomdoc-cli/img/console-screenshot.png)\n*An example of the command line tool reporting an issue and a verbose output. The source of the fixture is [here](https://github.com/GarthDB/atomdoc-cli/blob/00cdb06a5e9420d28d1adac1eed4ae7198c2e47b/test/fixtures/nested_functions.js).*\n\nA JS lib and command line tool to check for missing [AtomDoc](https://github.com/atom/atomdoc) information in a javascript project.\n\nIt inspects js code for functions and methods looking for things like parameters and return statements then compares that information against the AtomDoc comments. It highlights potentially missing information and can be used as part of build validation (like linting or automated tests) in a continuous integration setup like Travis CI.\n\nAtomDoc is a comment documentation format, created by GitHub. It is based on markdown, which for many teams, is easier to adopt than more complex formats. Take a look at GitHub's [maximal example](https://github.com/atom/atomdoc#maximal-example) for a quick guide on how to use it.\n\nYou can also look at the [source code](https://github.com/GarthDB/atomdoc-cli/tree/master/src) of this project to find examples like this one:\n\n```js\nexport default class AtomDocDocument {\n  /**\n   *  Public: constructor for AtomDocDocument instance.\n   *\n   *  * `content` {String} the raw content of the javascript file to be parsed and inspected.\n   *\n   *  ## Examples\n   *\n   *  ```js\n   *  const content = fs.readFileSync(filepath, 'utf-8');\n   *  const doc = new AtomDocDocument(content);\n   *  ```\n   */\n  constructor(content) {\n    this.content = content;\n  }\n  /**\n   *  Public: parses javascript document defined by `this.filepath`.\n   *\n   *  ## Examples\n   *\n   *  ```js\n   *  const content = fs.readFileSync(filepath, 'utf-8');\n   *  const doc = new AtomDocDocument(content);\n   *  doc.process().then(result =\u003e {\n   *    result.parserResult;\n   *    result.inspectorResult;\n   *  });\n   *  ```\n   *\n   *  Returns {Promise} that resolves with a {Result} instance.\n   */\n  process() {\n    const commentParser = new CommentParser();\n    const contentParser = new ContentParser(this.content, commentParser);\n    const contentInspector = new ContentInspector(this.content);\n    falafel(this.content, {\n      sourceType: 'module',\n      ecmaVersion: '6',\n      onComment: commentParser.parseComment.bind(commentParser),\n      locations: true,\n      allowHashBang: true,\n    }, (node) =\u003e {\n      contentInspector.inspectNode(node);\n      contentParser.parseNode(node);\n    });\n    return Promise.all([contentParser.promise, contentInspector.promise]).then(result =\u003e\n      new Result(result)\n    );\n  }\n}\n```\n\n## Installation\n\nTo use the cli just install globally via npm:\n\n```sh\n$ npm install -g atomdoc-cli\n```\n\nTo use as the js api save the install in your project via npm:\n\n```sh\n$ npm install --save atomdoc-cli\n```\n\n## Usage\n\n### CLI\n\nThe help has the basic information for using the command line tool:\n\n```sh\n$ atomdoc -h\n\n  Usage: atomdoc \u003cfile\u003e\n\n  A CLI interface for AtomDoc\n\n  Options:\n\n    -h, --help                    output usage information\n    -V, --version                 output the version number\n    -o, --output-path [filename]  Where to write out, defaults to stdout if not specified.\n    -r, --reporter [packagename]  Path or package name of a reporter to use\n    -v, --verbose                 Show full report, without it, this tool will only show errors\n```\n\n#### `--output-path`\n\nThe `output-path` flag will write the inspection and parser report to a json file.\n\n```sh\n$ atomdoc ./test/fixtures/class.js --output-path\nFile ./api.json written.\n```\n\nYou can also specify the filename/path:\n\n```sh\n$ atomdoc ./test/fixtures/class.js --output-path report.json\nFile report.json written.\n```\n\n#### `--reporter`\n\nThe default reporter is [`basic_reporter`](https://github.com/GarthDB/atomdoc-cli/blob/master/src/lib/basic_reporter.js). It will be used if no reporter is specified:\n\n```sh\n$ atomdoc ./test/fixtures/class.js\n./test/fixtures/class.js Container.list (Public) line 9\nExamples: Missing Add `## Examples` to public methods\n```\n\nYou can write your own reporter. It just needs to be a function that expects the `results` [{Result}](https://github.com/GarthDB/atomdoc-cli/blob/master/src/lib/index.js#L9) and `showAll` [{Bool}] as parameters.\n\nYou can also pass in a package name that's installed in the node_modules directory.\n\n#### `--verbose`\n\nIf you want to see passing results as well as errors, just include the `verbose` flag; otherwise it just shows the failing results.\n\n```sh\n$ atomdoc ./test/fixtures/class.js\n./test/fixtures/class.js Container.list (Public) line 9\nExamples: Missing Add `## Examples` to public methods\n```\n\nWith the verbose flag:\n\n```sh\n$ atomdoc ./test/fixtures/class.js -v\n./test/fixtures/class.js Container.list (Public) line 9\nName:      list\nClass:     Container\nArg Count: 1\nArg Name:  val\nReturn:    true\nExamples:  Missing   Add `## Examples` to public methods\n```\n\n### JS API\n\nThis can also be used as a javascript library.\n\n```js\nvar AtomDocDocument = require('../lib/');\n\nconst doc = new AtomDocDocument(content);\ndoc.process().then(result =\u003e {\n  result.parserResult; // {Array} of AtomDoc {Doc} objects.\n  result.inspectorResult; // {Array} of {InspectorMethod} objects.\n});\n```\n\n### NPM Script and Continuous Integration\n\nIt can also be used as a code verification tool with continuous integration workflow like Travis CI.\n\nThis project uses it right next to eslint and ava tests to validate the build:\n\nIn the `package.json` you can add it like this:\n\n```json\n\"scripts\": {\n  \"test\": \"nyc ava\",\n  \"lint\": \"eslint .\",\n  \"checkdocs\": \"atomdoc src\",\n  \"validate\": \"npm run lint \u0026\u0026 npm run test \u0026\u0026 npm run checkdocs\",\n},\n```\n\nIn the `.travis.yml` you can configure the validation:\n\n```yml\nlanguage: node_js\nnode_js: \"6\"\nscript:\n  - npm run validate\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarthdb%2Fatomdoc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarthdb%2Fatomdoc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarthdb%2Fatomdoc-cli/lists"}