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 🙏

© 2026 – Pkg Stats / Ryan Hefner

run-task

v1.3.0

Published

Simple-as-possible task runner

Readme

run-task

A simple cli task runner. When you would prefer to write code rather than shell scripts in package.json, but would rather not spend a lot of time learning a build tool.

Requires node v4 or newer.

Usage

run-task returns a function that takes an object as an argument. The keys are the names of tasks and the values are functions for those tasks.

  • Write some functions, then pass in the ones you want to be tasks.
// filename: run.js

const tasks = require('run-task')

function foo () {
  console.log('foo')
}

function bar () {
  console.log('bar')
}

function foobar () {
  foo()
  bar()
}

tasks({
  bar,
  foobar
})
  • Execute using node [script] [task].
$ node run foobar
  • If you use JSDoc comments, it will pick up the description. You can also add a description by attaching a description property to the function.
/**
 * This will show up as the task's description on stdout.
 */
function bar () {
  console.log('bar')
}
function bar () {
  console.log('bar')
}

bar.description = "This will show up as the task's description on stdout."
  • You can pass in more than one task.
$ node run bar foobar
  • If you don't provide a task argument, it will list the available tasks.
$ node run
[run] Available tasks:
[run] bar - This will show up as the task's description on stdout.
[run] foobar
  • You can also pass in a -q flag to silence the run-task logging.
$ node run bar -q
bar

That's it. It just runs functions from the command line. There are no assumptions on what kind of tasks you want to run.

Because of this, you'll probably want to require some other modules in your run.js script.

  • There's a lot you can get done with the core api, read the docs
  • Check out a curated list of modules at awesome-nodejs.
  • shelljs is a great tool for tasks (cross-platform *nix commands for node).

Other Suggestions

  • Take advantage of the property shorthand.
  • Name the file containing the tasks run.js so you can use: node run [task].