Socket
Socket
Sign inDemoInstall

jsdoc-to-markdown

Package Overview
Dependencies
10
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdoc-to-markdown


Version published
Maintainers
1
Created

Package description

What is jsdoc-to-markdown?

The jsdoc-to-markdown npm package is a tool that generates markdown documentation from JSDoc comments in your JavaScript code. It is useful for creating comprehensive and readable documentation for your projects.

What are jsdoc-to-markdown's main functionalities?

Generate Markdown Documentation

This feature allows you to generate markdown documentation from JSDoc comments in your JavaScript files. The code sample demonstrates how to use jsdoc-to-markdown to read JSDoc comments from JavaScript files in the 'src' directory and output the generated markdown to 'docs/api.md'.

const jsdoc2md = require('jsdoc-to-markdown');
const fs = require('fs');

const inputFiles = 'src/**/*.js';
const outputFile = 'docs/api.md';

jsdoc2md.render({ files: inputFiles })
  .then(output => fs.writeFileSync(outputFile, output));

Customizing the Output

This feature allows you to customize the output of the generated markdown documentation using a template. The code sample shows how to use a custom template to format the documentation for a specific module.

const jsdoc2md = require('jsdoc-to-markdown');
const fs = require('fs');

const inputFiles = 'src/**/*.js';
const outputFile = 'docs/api.md';

const template = `{{#module name="myModule"}}{{>docs}}{{/module}}`;

jsdoc2md.render({ files: inputFiles, template: template })
  .then(output => fs.writeFileSync(outputFile, output));

Filtering Output

This feature allows you to filter the output of the generated markdown documentation. The code sample demonstrates how to disable GitHub Flavored Markdown (GFM) in the output by setting the 'no-gfm' option to true.

const jsdoc2md = require('jsdoc-to-markdown');
const fs = require('fs');

const inputFiles = 'src/**/*.js';
const outputFile = 'docs/api.md';

jsdoc2md.render({ files: inputFiles, 'no-gfm': true })
  .then(output => fs.writeFileSync(outputFile, output));

Other packages similar to jsdoc-to-markdown

Readme

Source

view on npm npm module downloads Build Status Coverage Status Dependency Status js-standard-style Join the chat at https://gitter.im/jsdoc2md/jsdoc2md

jsdoc-to-markdown

Generates markdown API documentation from jsdoc annotated source code. Useful for injecting API docs into project README files.

Synopsis

1. Document your code using valid jsdoc comments.

/**
 * A quite wonderful function.
 * @param {object} - privacy gown
 * @param {object} - security
 * @returns {survival}
 */
function protection (cloak, dagger) {}

2. Run a command.

$ jsdoc2md example.js

3. Get markdown output.

## protection(cloak, dagger) ⇒ <code>survival</code>
A quite wonderful function.

**Kind**: global function  

| Param  | Type                | Description  |
| ------ | ------------------- | ------------ |
| cloak  | <code>object</code> | privacy gown |
| dagger | <code>object</code> | security     |

Install

$ npm i -g jsdoc-to-markdown@^2.0.0-alpha

See also

  • API documentation
  • The wiki for example output, FAQs, tutorials, plugins, use with gulp/grunt etc.

© 2014-16 Lloyd Brookes 75pound@gmail.com.

Keywords

FAQs

Last updated on 03 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc