1.1.1 • Published 5 years ago

count-todos v1.1.1

Weekly downloads
57
License
MIT
Repository
github
Last release
5 years ago

count-todos

Count all todo's in your repository

Install

$ yarn add count-todos

Usage

// example.js
const countTodos = require('count-todos');

console.log(countTodos());
//=> 2 

API

count-todos expects that your TODO comments are followed by a colon and a whitespace character. Examples of TODO's that will match:

// TODO: This thing needs fixing

/* Todo: Fix this thing */

/**
  * todo: This is a problem
  *
  **/ 

countTodos(filePath, options)

Returns a number based on a grep of the repository excluding by default node_modules, flow-typed, .idea, .vscode, and .git.

filePath

  • Type: string
  • Default: process.cwd()

Optionally pass in the path to the repository you wish to count.

options

  • Type: object
NameTypeDescriptionDefault
excludeArray<string>A list of directories to exclude from the search. List is added to the list of defaults[]
fileTypesArray<string>A list of file types to ignore, eg [.md, .jpg, .txt][]
verbosebooleanWhether or not the grep search command should be printedfalse

License

MIT © Matt McElwee