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

casker

v0.4.1

Published

A task runner modeled after npm scripts, but with a task dependency graph, easy parallel/serial execution, and up to date checking of inputs.

Downloads

89

Readme

Casker

A task runner modeled after npm scripts, but with a task dependency graph, easy parallel/serial execution, and up to date checking of inputs.

Install locally in project, then global cli will use local version.

npm install casker --save-dev && npm install -g casker

original package.json

{
	"scripts": {
		"compile": "tsc",
		"lint": "jshint",
		"test": "jest",
		"build": "npm run compile && npm run lint && npm run test"
	}
}

new caskerfile.ts

import {casker} from 'casker';

const {task, tasksParallel, tasksSeries} = casker();
const srcFiles= './src/**/*.*';

const install = task('install', 'npm install', { inputs: ['package.json', 'yarn.lock'], description: 'Install dependencies' });
const lint = task('lint', 'tslint', {dependsOn: install, inputs: [srcFiles, './tslintconfig.json'], description: 'Run linter' });
const test = task('test', 'jest', {dependsOn: install, inputs: [srcFiles, './jest.config.json'], description: 'Run tests' });
const compile = task('compile', 'tsc', {dependsOn: install, inputs: [srcFiles, './tsconfig.json'], description: 'Compile typescript' });

tasksParallel('buildParallel', compile, lint, test);
tasksSeries('buildSeries', compile, lint, test);

With a bit more effort we now have tasks that will make sure dependencies are up to date and only re-run when a file actually changes. We can also easily parallelize tasks instead of just running them sequentially. As the build grows in complexity the benefits only increase.

Run a task

casker test

install started
install output
...
install finished (4.933s)
test started
test output
...
test finished (13.313s)

List tasks by running without any arguments

casker

Tasks
install - Install dependencies
lint - Run jshint
test - Run tests
compile - Compile typescript
buildParallel - Execute tasks compile, lint, test in parallel
buildSeries - Execute tasks compile, lint, test in series

Features

  • Simple script execution just like npm 'scripts'
    • Will look for globally installed modules and in the local node_modules/.bin
  • Create task dependencies
  • Run tasks in series or parallel
  • Multi-Project support
  • Typescript support
  • Logs are aggregated by task
    • With option for streaming logs for any task
  • Run tasks in the background
    • Will be automatically killed once build is finished
  • Up to date checking of inputs

Examples

NOTE: The examples include casker from the dist directory whereas a normal project would just import 'casker'.

See examples of different features and setups here.

They are also used for full functional testing of features.

API

Typescript definitions can be found here.

task(name, cmd, [options])

name

The name of this task used for running from the command line.

cmd

The command the task will run, the same as if creating a task with npm scripts.

options

env

Override environment variables.

runInBackground

Casker will start this task process then immediately continue on to the next task while allowing this one to run in the background. When all tasks have executed tasks run in the background will be killed automatically. Good for starting servers to run tests against.

description

Task description that will show up when listing tasks.

dependsOn

Sets a dependency for this task that will execute before this task.

onExit

Sets a task to run after this task exits regardless of exit code. Good for dropping databases after tests.

inputs

When the array value is a string it is treated as a glob of files, and the modified timestamp (mtime) from fs.stat to determine if any matching file as changed. Otherwise a promise that returns a string or number array can also be defined for custom checking.

streamLogs

Normally task output is grouped together for easier reading, but when this is set to true the logs will be streamed as they are output from the child process. This is useful for tasks that start a dev server for local development or run tests in a watch mode.

tasksParallel(name, task1, task2, ...)

name

The name of this task used for running from the command line.

task

Each argument after the name must be a task and will be run in parallel. This task will not complete until all tasks complete.

tasksParallel(name, task1, task2, ...)

name

The name of this task used for running from the command line.

task

Each argument after the name must be a task and will be run in order. This task will not complete until all tasks complete.