Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-jsdoc with all npm packages installed. Try it out:

var gulpJsdoc = require("gulp-jsdoc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-jsdoc v0.1.5

A jsdoc plugin for Gulp


NPM version Build Status Coverage Status Dependency Status Code Climate

jsdoc plugin for gulp


jsdoc is currently (alpha5+) going through important inner modifications. Also, jsdoc has an history at doing quesitonable things (certainly, at least in part, due to its desire to support alternative javascript engines like Rhino), including, not limited to, hard copying files into the module folder at runtime (templates), and using non standard require calls and paths. Finally, jsdoc really is not meant to be used as a library. It provides a cli, and little more, with no clean/stable library API.

All in all, maintaining a working "true" gulp plugin (one that uses streams and does not simply call a binary) proved to be a very painful task, with ultimately little benefit, as I stopped using jsdoc altogether for my own uses.

For all these reasons, I decided to stop maintaining this plugin, and won't work on it until at least a new jsdoc stable version is released. If you still use it and have a PR, I'll review it though.


Install gulp-jsdoc as a development dependency:

npm install --save-dev gulp-jsdoc

Then, use it:

var jsdoc = require("gulp-jsdoc");



jsdoc.parser(infos, name)

  .pipe(jsdoc.parser(infos, name))

Will process any files it has been fed, and generate a new vinyl JSON usable by the generator to produce actual documentation.

By default, the filename is 'jsdoc.json' unless overriden by the name parameter.

Note that if you feed the parser a file, this file will be rendered and used as a long description for your package.


gulp.src(["./src/*.js", ""])
  .pipe(jsdoc.parser(infos, name))

The optional infos parameter is fed to jsdoc.

Type: String
Default: ''


Type: String
Default: ''


Type: String
Default: ''


Type: Array
Default: []


Type: Array
Default: false

jsDoc plugins to use. Example: ['plugins/markdown']

jsdoc.generator(destination, template, options)


or directly from the parser pipe:

gulp.src(["./src/*.js", ""])
  .pipe(jsdoc.parser(infos, name))

By default, the generator uses the default template.


Type: String
Default: ''

Where the documentation will be outputed. If an infos object with a version / name was provided to the parser, these will be used in the final path.


You may optionnally specify a custom template, using the following syntax

  path: 'path_to_template',
  anyTemplateSpecificParameter: 'whatever'

As a courtesy, gulp-jsdoc bundles ink-docstrap templates, that you may use directly this way:

    path            : "ink-docstrap",
    systemName      : "Something",
    footer          : "Something",
    copyright       : "Something",
    navType         : "vertical",
    theme           : "journal",
    linenums        : true,
    collapseSymbols : false,
    inverseNav      : false

See their site for more infos.


You may optionnally override default jsdoc behavior with this object:

    showPrivate: false,
    monospaceLinks: false,
    cleverLinks: false,
    outputSourceFiles: true

jsdoc(destination, template, infos, options)

gulp.src(["./src/*.js", ""])

... is simply a shortcut for

gulp.src(["./src/*.js", ""])


Only the parser is really using streams. While the generator will read from the result of the parser, it will also read and write templates files synchronously on its own.

There is nothing we can do about that, unless changing the jsdoc templating API entirely, and all existing templates...

Also, the following are currently not supported:

  • tutorials
  • sourcing configuration from jsdoc.conf files

If you have a use-case that you can't do with straight gulp in a better way, please say so.


MIT License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free