broccoli-extract-comments
v0.0.4
Published
Extract code comments from source files
Downloads
2
Readme
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