# ntodo

> A simple CLI TODO/FIXME parser for the lazy coder

Latest version **1.0.2** (published 2020-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ntodo
pnpm add ntodo
yarn add ntodo
bun add ntodo
```

Provides the command `ntodo`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-09-14 |
| First published | 2011-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9.4 |
| Dependencies | 10 |
| Unpacked size | 377.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christian Sanz |
| Maintainers | csanz |
| Keywords | todo, fixme, cli, github, utils |

## Links

- npm: https://www.npmjs.com/package/ntodo
- Repository: https://github.com/csanz/node-ntodo
- Homepage: https://github.com/csanz/node-ntodo#readme
- Issues: https://github.com/csanz/node-ntodo/issues
- npm.io page: https://npm.io/package/ntodo

## Dependencies (10)

- [klaw](https://npm.io/package/klaw.md) 3.0.0
- [async](https://npm.io/package/async.md) 3.0.1-0
- [mocha](https://npm.io/package/mocha.md) 5.2.0
- [ntodo](https://npm.io/package/ntodo.md) 0.1.2
- [colors](https://npm.io/package/colors.md) *
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [optimist](https://npm.io/package/optimist.md) >= 0.6.1
- [through2](https://npm.io/package/through2.md) 3.0.0
- [commander](https://npm.io/package/commander.md) 2.19.0
- [line-reader](https://npm.io/package/line-reader.md) 0.4.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-09-14
- 1.0.1 — 2019-02-04
- 1.0.0 — 2019-01-22
- 0.1.4 — 2019-01-09
- 0.1.3 — 2019-01-09
- 0.1.2 — 2019-01-07
- 0.1.1 — 2019-01-07
- 0.1.0 — 2019-01-07
- 0.0.9 — 2018-12-29
- 0.0.8 — 2018-12-29
- 0.0.7 — 2018-12-29
- 0.0.6 — 2018-12-28
- 0.0.5 — 2018-12-28
- 0.0.4 — 2018-12-28
- 0.0.3 — 2011-06-03
- … 2 more at https://npm.io/package/ntodo/versions

## README

# ntodo [![Build Status](https://travis-ci.org/csanz/ntodo.svg?branch=master)](https://travis-ci.org/csanz/ntodo)

A simple to use CLI TODO/FIXME parser for the lazy coder

![Screenshot](https://raw.githubusercontent.com/csanz/ntodo/master/misc/ntodo.png?bust=4)

The much much simpler version is to just use git grep

``` bash
  $ git grep -EI "TODO|FIXME"
```

You can find the full documentation [here](https://git-scm.com/docs/git-grep)

`ntodo` is useful if you are looking for something you can interact with both via terminal and also programatically and pull more meta data like author, date added, etc as an array of objects.  

`ntodo` will also include the ability to prioritize and synchronize with your own task tools while keeping the easy to use in-code TODO and FIXME convention. 

The issue today with TODO and FIXME is that they never get looked at... unless you run into them while fixing code.  

## Installation

``` bash
  $ [sudo] npm install ntodo -g
```

## Usage

There are two ways to view TODOs: through the command line or by using ntodo in your code. **Note:** If you are using ntodo _programatically_ see example below.

To add new TODOs it is super easy. Simply add a TODO to your source code

    // TODO: new todo text here 

Then pull them via your terminal or code. It will output a summary of TODOs with the line number of where to find it. You can also track general TODOs inside .todo.js at the root of your project. 

### Command Line Usage

**Options**
```
    $ ntodo --help
    Usage: ntodo [Options]
    
    [Options]
    
    -h, --help      Display help
    -p, --path      It sets the path
                      ex: ntodo -p ./
    -s, --summary   Output summary
                      ex: ntodo -s ./
    
    you can also skip the -p 
    
    ntodo .
    ntodo ./    
``` 

**Example**

Standard search

``` bash
  $ ntodo ./
```

Get summary

``` bash
  $ ntodo -s ./
```

This returns a summary instead of a list of TODOs. This can be interesting when analyzing multiple projects to see how many TODOs are there in aggregate like this:

``` bash
  $ ntodo -s ./folder_with_all_projects/
```

``` bash
    +++++++++

    Total Number of TODOs: 4000

    Inside the following folders:

    ./application1 3000

    ./application2 1000
```


### Programatically
You can also use ntodo from inside your own node.js code.

``` js
  var ntodo = require('ntodo');

  var results = (err, results) => {
    console.log("results: %s", results)
    console.log("errors: %s", err)
  }

  ntodo.search("./", results);
```

You should see something like this

```
results: [
  {"file_name":"bin/app.js"
  ,"todos":[
      {"line":"// TODO: Add file watcher","line_number":20}
    , {"line":"// TODO: clean up the emtpy todos and then callback","line_number":128}]}
 ,{"file_name":"bin/cli.js"
  ,"todos":[
      {"line":"// TODO: Add the ability to remove the TODO line... more options","line_number":67}
     ,{"line":"// TODO: Add the ability to connect your todo app or Github","line_number":68}]}
 ,{"file_name":"test/test.js","todos":[
      {"line":"// TODO: create test","line_number":0}]}
 ]
errors: null
```

---
_Source: https://npm.io/package/ntodo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
