Gathering detailed insights and metrics for @nhz.io/gulp-todo
Gathering detailed insights and metrics for @nhz.io/gulp-todo
Gathering detailed insights and metrics for @nhz.io/gulp-todo
Gathering detailed insights and metrics for @nhz.io/gulp-todo
Generate a TODO.md from todos & fixmes in your code using Gulp stream
npm install @nhz.io/gulp-todo
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
91 Stars
215 Commits
23 Forks
6 Watchers
2 Branches
12 Contributors
Updated on Jul 17, 2024
Latest Version
5.0.3
Package Id
@nhz.io/gulp-todo@5.0.3
Size
4.18 kB
NPM Version
3.10.6
Node Version
6.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
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
Install with npm
1$ npm install --save-dev gulp-todo
1var gulp = require('gulp'); 2var todo = require('gulp-todo'); 3 4// generate a todo.md from your javascript files 5gulp.task('todo', function() { 6 gulp.src('js/**/*.js') 7 .pipe(todo()) 8 .pipe(gulp.dest('./')); 9 // -> Will output a TODO.md with your todos 10}); 11 12// generate todo from your jade files 13gulp.task('todo-jade', function() { 14 gulp.src('partials/**/*.jade') 15 .pipe(todo({ fileName: 'jade-todo.md' })) 16 .pipe(gulp.dest('./')); 17 // -> Will output a jade-todo.md with your todos 18}); 19 20// get filenames relative to project root (where your gulpfile is) 21gulp.task('todo-absolute', function() { 22 gulp.src('js/**/*.js') 23 .pipe(todo({ 24 absolute: true 25 })) 26 .pipe(gulp.dest('./')); 27}); 28 29// get relative path filenames 30gulp.task('todo-absolute', function() { 31 gulp.src('js/**/*.js', { base: '/' }) 32 .pipe(todo()) 33 .pipe(gulp.dest('./')); 34}); 35 36// create a json output of the comments (useful for CI such as jenkins) 37gulp.task('todo-json', function () { 38 gulp.src('./**/*.js', { 39 base: './' 40 }) 41 .pipe(todo({ 42 fileName: 'todo.json', 43 reporter: 'json' 44 })) 45 .pipe(gulp.dest('./')); 46}); 47 48// output once in markdown and then output a json file as well 49gulp.task('todo-reporters', function() { 50 gulp.src('js/**/*.js') 51 .pipe(todo()) 52 .pipe(gulp.dest('./')) //output todo.md as markdown 53 .pipe(todo.reporter('json', {fileName: 'todo.json'})) 54 .pipe(gulp.dest('./')) //output todo.json as json 55}); 56 57 58// Delete the todo.md file if no todos were found 59var gulpIf = require('gulp-if'); 60var del = require('del'); 61var vinylPaths = require('vinyl-paths'); 62gulp.task('todo-delete', function() { 63 gulp.src('js/**/*.js') 64 .pipe(todo()) 65 .pipe(gulpIf(function (file) { 66 return file.todos && Boolean(file.todos.length); 67 }, vinylPaths(del), gulp.dest('./')); 68});
If you want to inject the generated todo stream into another file (say a readme.md.template
)
you can do the following:
readme.md.template
file that contains the following marker, marking where you want to inject the generated todo file:1### some previous content 2<%= marker %>
1var fs = require('fs'); 2var path = require('path'); 3var gulp = require('gulp'); 4var todo = require('gulp-todo'); 5var template = require('lodash.template'); 6var through = require('through2'); 7 8gulp.task('default', function () { 9 gulp.src('./js/**/*.js') 10 .pipe(todo()) 11 .pipe(through.obj(function (file, enc, cb) { 12 //read and interpolate template 13 var tmpl = fs.readFileSync('./readme.md.template', 'utf8'); 14 var compiledTpl = template(tmpl); 15 var newContents = compiledTpl({ 16 'marker': file.contents.toString() 17 }); 18 //change file name 19 file.path = path.join(file.base, 'readme-new.md'); 20 //replace old contents 21 file.contents = new Buffer(newContents); 22 //push new file 23 this.push(file); 24 cb(); 25 })) 26 .pipe(gulp.dest('./')); 27});
See https://github.com/pgilad/leasot#supported-languages
options
is an optional object, that may contain the following properties:
Specify the output filename.
Type: String
Default: TODO.md
Output comments to console as well.
Type: Boolean
Default: false
Output absolute paths of files (as available via file.path
)
See customTags.
See withInlineFiles.
Which reporter to use.
All other params
are passed along to the selected reporter (except verbose
and fileName
)
For options and more information about using reporters, see: https://github.com/pgilad/leasot#reporter and https://github.com/pgilad/leasot#built-in-reporters
Type: String|Function
Default: markdown
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
Same options as the above settings for reporter
Pass along options to the reporter, and also if you pass a fileName
- it will rename the filename in stream.
MIT @Gilad Peleg
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More