Gathering detailed insights and metrics for gulp-todo
Gathering detailed insights and metrics for gulp-todo
Gathering detailed insights and metrics for gulp-todo
Gathering detailed insights and metrics for gulp-todo
Generate a TODO.md from todos & fixmes in your code using Gulp stream
npm install 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
7.1.1
Package Id
gulp-todo@7.1.1
Size
4.33 kB
NPM Version
6.7.0
Node Version
11.9.0
Published on
Feb 13, 2019
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
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 with npm
1$ npm install --save-dev gulp-todo
1const gulp = require('gulp'); 2const 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 59const gulpIf = require('gulp-if'); 60const del = require('del'); 61const vinylPaths = require('vinyl-paths'); 62 63gulp.task('todo-delete', function() { 64 gulp.src('js/**/*.js') 65 .pipe(todo()) 66 .pipe(gulpIf(function (file) { 67 return file.todos && Boolean(file.todos.length); 68 }, gulp.dest('./'), vinylPaths(del))); 69});
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 %>
1const fs = require('fs'); 2const path = require('path'); 3const gulp = require('gulp'); 4const todo = require('gulp-todo'); 5const template = require('lodash.template'); 6const 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 const tmpl = fs.readFileSync('./readme.md.template', 'utf8'); 14 const compiledTpl = template(tmpl); 15 const 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 = Buffer.from(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 configuration object, see https://github.com/pgilad/gulp-todo/blob/master/index.js#L22-L32
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
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