Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-comments

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-comments

Exports all jsdocs-style comments from either .js or .ts files

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-6.67%
Maintainers
3
Weekly downloads
 
Created
Source

gulp-comments

Exports all jsdocs-style comments from either .js or .ts files.

Build Status

This is used as a workaround for when the TypeScript compiler strips jsdoc comments from its output. By extracting the comments first, you can run the output directly from .ts files into jsdocs.

Install

npm i gulp-comments --save-dev

Usage

The examples below illustrate usage in a gulp file. (Note that this plugin auto converts all file extentions to .js for the benefit of jsdocs.)

Write the comments directly to files:

var gulp = require('gulp');
var comments = require('gulp-comments');

gulp.task('comments', function() {
    return gulp.src('src/**/*.{ts,js}')
        .pipe(comments())
        .pipe(gulp.dest('lib/docs'));
});

Stream comments directly into gulp-jsdocs:

var gulp = require('gulp');
var comments = require('gulp-comments');
var jsdoc = require('gulp-jsdoc');

gulp.task('docs', function(done) {
    gulp.src('/src/**/*.{ts,js}')
        .pipe(comments())
        .pipe(jsdoc('docs.json', done));
});

Options

An optional filter parameter can be added when calling comments(). Any jsdoc block containing this string will be excluded from publishing. Can be useful for creating custom documentation builds.

//...
.pipe(comments('@internal'))
// ...

Multiple Filters

//...
.pipe(comments('@internal,@justforme'))
// ...

Keywords

FAQs

Package last updated on 28 Apr 2017

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc