gulp-todo
Parse and output TODOs and FIXMEs from comments in your file in a stream
Parse your files in a gulp-stream, extracting todos/fixmes from comments and reporting them in a reporter to your choosing using leasot.
Issues with the output should be reported on the leasot issue tracker
Supports latest leasot
version 7.0.0
.
Please upgrade carefully to version 7.0.0
, there were breaking changes in the gulp-todo
API
Install
Install with npm
$ npm install --save-dev gulp-todo
Usage
const gulp = ;const todo = ; // generate a todo.md from your javascript filesgulp; // generate todo from your jade filesgulp; // get filenames relative to project root (where your gulpfile is)gulp; // get relative path filenamesgulp; // create a json output of the comments (useful for CI such as jenkins)gulp; // output once in markdown and then output a json file as wellgulp; // Delete the todo.md file if no todos were foundconst gulpIf = ;const del = ;const vinylPaths = ; gulp;
Injecting the todo generated file into another template
If you want to inject the generated todo stream into another file (say a readme.md.template
)
you can do the following:
- Create
readme.md.template
file that contains the following marker, marking where you want to inject the generated todo file:
### some previous content<%= marker %>
- Use the following code to inject into that markdown, creating a markdown file with the generated todo:
const fs = ;const path = ;const gulp = ;const todo = ;const template = ;const through = ; gulp;
Supported Filetypes
See https://github.com/pgilad/leasot#supported-languages
API
todo(options)
options
is an optional configuration object, see https://github.com/pgilad/gulp-todo/blob/master/index.js#L22-L32
todo.reporter(reporter, options)
options
is an optional configuration object, see https://github.com/pgilad/gulp-todo/blob/master/lib/reporter.js#L10-L16
Use another reporter in stream, will replace the contents of the output file.
Must be used after todo()
, since it uses the file.todos
that are passed along.
See the example in the usage
License
MIT © Gilad Peleg