npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-doggy

v0.0.1

Published

New gulp-jsdoc modified by myself

Downloads

3

Readme

gulp-jsdoc

NPM version Build Status Coverage Status Dependency Status Code Climate

jsdoc plugin for gulp

BIG FAT WARNING

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.

TL;DR

Install gulp-jsdoc as a development dependency:

npm install --save-dev gulp-jsdoc

Then, use it:

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

gulp.src("./src/*.js")
  .pipe(jsdoc('./documentation-output'))

API

jsdoc.parser(infos, name)

gulp.src("./src/*.js")
  .pipe(jsdoc.parser(infos, name))
  .pipe(gulp.dest('./somewhere'))

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 README.md file, this file will be rendered and used as a long description for your package.

eg:

gulp.src(["./src/*.js", "README.md"])
  .pipe(jsdoc.parser(infos, name))
  .pipe(gulp.dest('./somewhere'))

The optional infos parameter is fed to jsdoc.

infos.name

Type: String
Default: ''

infos.description

Type: String
Default: ''

infos.version

Type: String
Default: ''

infos.licenses

Type: Array
Default: []

infos.plugins

Type: Array
Default: false

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

jsdoc.generator(destination, template, options)

gulp.src("./somewhere/jsdoc.json")
  .pipe(jsdoc.generator('./destination'))

or directly from the parser pipe:

gulp.src(["./src/*.js", "README.md"])
  .pipe(jsdoc.parser(infos, name))
  .pipe(jsdoc.generator('./destination'))

By default, the generator uses the default template.

destination

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.

template

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.

options

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", "README.md"])
  .pipe(jsdoc('./destination'))

... is simply a shortcut for

gulp.src(["./src/*.js", "README.md"])
  .pipe(jsdoc.parser())
  .pipe(jsdoc.generator('./destination'))

Limitations

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.

License

MIT License