broccoli-extract-comments

0.0.4 • Public • Published

broccoli-extract-comments

Extract code comments from source files

This broccoli-plugin let's you extract code comments and write into an output-file.

Basic Usage

// Brocfile.js
var extractComments = require('broccoli-extract-comments');
 
var commentsTree = extractComments('src', {
  inputFiles: [
    '**.*'
  ],
  outputFile: 'comments.txt'
});
 
module.exports = commentsTree;

Options

options.allowNone

Type: Boolean Default value: false

Allows for empty file paths in broccoli's globbing pattern

options.raw

Type: Boolean Default value: false

Specifies whether to output raw comments instead of extracted text.

options.filter

Type: Function Default value: null

Specify a callback-function to filter desired comments, i.e.:

function(comment) {
  return comment.text.indexOf('Hello World!') >= 0;
}

options.outputFile

Type: String Default value: "comments.txt"

Specifies destination file for extracted comments

options.separator

Type: String Default value: "\n"

Specifies separator for concatenated comments

Readme

Keywords

Package Sidebar

Install

npm i broccoli-extract-comments

Weekly Downloads

2

Version

0.0.4

License

MIT

Last publish

Collaborators

  • rexblack