count-todos

1.1.1 • Public • Published

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
Name Type Description Default
exclude Array<string> A list of directories to exclude from the search. List is added to the list of defaults []
fileTypes Array<string> A list of file types to ignore, eg [.md, .jpg, .txt] []
verbose boolean Whether or not the grep search command should be printed false

License

MIT © Matt McElwee

Readme

Keywords

none

Package Sidebar

Install

npm i count-todos

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

19.3 kB

Total Files

9

Last publish

Collaborators

  • renddslow