npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whatodo

v0.4.21

Published

A TODO collector, organizer, and task manager

Downloads

70

Readme

  • Install
  • API Usage
  • CLI Usage

https://whatodo.io (coming soon)

A TODO collector, organizer, and task manager

Do you write TODO comments all over your code?

I certainly do.

Wouldn't it be nice to pull those TODOs out and have priorities, links to where to your code, all ready to go?

Install

npm i -g whatodo

List priorities:

  • // TODO: low priority
  • // TODO:: mid priority
  • // TODO::: high priority

NPM Problems?

Try this: sudo npm install -g whatodo --unsafe-perm --allow-root

API Usage

Options:

  • input - input file or directory
  • ignore - array of files or directories to ignore
  • ignoreExts - array of extensions to ignore
  • todoPattern - regex pattern to search for (default: '\\/\\/ ?TODO:?:?:? ?')
  • outputFile - specify the file where the todos are saved
  • outputFormat - format to export todos (JSON, STDOUT)
  • maximumFileSize - maximum file size to search (1 KiB, 1 Megabyte, 2 MB)
'use strict';

const Whatodo = require( 'whatodo' );

new Whatodo( {
    input: 'index.js',
    ignore: [ 'node_modules', '.git', '.idea', 'docs', 'build' ],
    ignoreExts: [ 'json', 'html', 'css', 'md' ],
    todoPattern: '\\/\\/ ?TODO:?:?:? ?',
    outputFile: 'todos.json',
    outputFormat: 'JSON',
    maximumFileSize: '1 MiB'
} )
    .initialize()
	.then( inst => inst.run() )
	.then( inst => inst.save() )
	.catch( console.error );

CLI Usage

Write your TODO comments throughout your code

When ready, run the todo cli to collect your comments:

todo -h

  
  Whatodo v0.3.0
  
  Whatodo is a NPM Module designed to quickly and efficiently extract your
  TODO comments from your code and organize them in a simple & readable format
  
  Usage:
  
    todo [input file/folder] [...options]
  
  Options:
  
    -h, --help      show this help menu
    -v, --version   show package version
    -i, --input     directory or file to check TODOs  (default: ./)
    -o, --output    file to save TODOs                (default: STDOUT)
    -f, --format    format to save/print TODOs        (default: STDOUT, JSON)
    -p, --pattern   pattern to capture TODOs          (default: "\/\/ ?TODO:?:?:? ?")
    -m, --maximum   maximum file size allowed         (default: "1 MB", 512KiB)
  

CLI usage print STDOUT

todo ./ -m 1KiB -p "\/\/ ?TEST:?:?:? ?"
whatodo/test/test.cc  (118 μs - 182 bytes)
    [low]  line: 1 - todo low priority
    [mid]  line: 2 - todo mid priority
    [high] line: 3 - todo high priority

Total: 3
High: 1
Mid: 1
Low: 1

CLI usage print JSON format and save to file

todo ./ -f JSON -o todos.json -m 1KiB -p "\/\/ ?TEST:?:?:? ?"

Specify:

  • JSON formatted output
  • Output file todos.json
  • Set a maximum search of 1 Kibibyte files
  • TODO search regex "\/\/ ?TEST:?:?:? ?"

Creates a TODOS.json file:

[
    {
        "file": "whatodo/test/test.cc",
        "timing": "120.263 μs",
        "todos": [
            {
                "priority": "LOW",
                "line": 1,
                "position": 0,
                "comment": "todo low priority"
            },
            {
                "priority": "MID",
                "line": 2,
                "position": 0,
                "comment": "todo mid priority"
            },
            {
                "priority": "HIGH",
                "line": 3,
                "position": 0,
                "comment": "todo high priority"
            }
        ],
        "size": 182
    }
]

Add todos to your package.json -> "scripts"

{
	"scripts": {
		"todo": "./node_modules/whatodo/cli.js -i ./ -o TODOS.json -f JSON && ./node_modules/whatodo/cli.js"`
	}
}

Then run npm run todo!