0.2.2 • Published 5 years ago

doc-comments v0.2.2

Weekly downloads
27
License
MIT
Repository
github
Last release
5 years ago

doc-comments

Extract comments from JavaScript source code and generate API documentation.

Typically you want to add it to the dev dependencies `npm install --save-dev doc-comments.

Then call it from a script, e.g. put

"scripts": {
  "doc": "node -e 'require(process.cwd())({files: [\"index.js\"]})'"
}

into your package.json and run npm run doc.

API

generateDoc(options, thenDo)

Reads JS source files, extracts toplevel, object, and function comments and generates a documentation from these. Will insert doc into README.md or doc files. options {dryRun: BOOL, projectPath: STRING, files: ARRAY[STRING], intoFiles: BOOL} intoFiles: split documentation into individual doc/xxx.md files or README.md (default). The README.md file should include insertion markers <!---DOC_GENERATED_START---> and <!---DOC_GENERATED_END--->.

var files = ["lib/foo.js", "lib/bar.js"];
require("doc-comments")({
  projectPath: "/foo/bar", files: files},
  function(err, markup, fileData) { /*...*/ })/
0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago