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

mukin

v0.0.2

Published

A tiny task runner built on native Node.js streams

Downloads

595

Readme

mukin

npm version license

A Minimal, dependency-free task runner. Define your tasks in a plain JavaScript file, connect src, each and dest into pipelines, and run them with a single command. Files flow through native Node.js object streams one by one, so thousands of them can be processed without loading them all in memory.

Installation

Install it locally in your project, so your tasks file and the CLI share the same copy of the library.

npm install --save-dev mukin

Requires Node.js 22 or later.

Usage

Create a mukin.config.js file in your project:

import { src, dest, each, pipeline, task, series, parallel } from "mukin";

task("pages", () => {
    return pipeline(
        src("src/**/*.html"),
        each((file) => {
            file.content = file.content.toString().toUpperCase();
        }),
        dest("dist"),
    );
});

task("assets", () => pipeline(src("src/assets/**/*"), dest("dist/assets")));

task("build", parallel("pages", "assets"));
task("default", series("build"));

Then run it:

npx mukin              # runs the "default" task
npx mukin build        # runs "build"
npx mukin pages assets # runs "pages", then "assets"
npx mukin --list       # lists the available tasks

CLI options

| Option | Description | | --- | --- | | -f, --file <path> | Tasks file to load. Default: mukin.config.js | | -l, --list | List the available tasks | | -h, --help | Show the help |

API

task(name, fn)

Registers a task. fn can be sync or async. If it returns a promise, or a stream, the task finishes when that promise or stream does. Always return it, otherwise mukin cannot wait for it.

pipeline(...streams)

Connects the streams, and returns a promise that resolves when the last one finishes. If any stream fails, the others are closed and the promise rejects. It is the pipeline function of node:stream/promises, re-exported for convenience.

src(patterns, [options])

Creates a stream with the files that match one or more glob patterns. The paths are listed first, but the content of each file is read only when the stream needs it.

  • patterns: a glob string or an array of them. Files are streamed in pattern order.
  • options.cwd: directory used to resolve the patterns. Default: .

Each file in the stream is an object with these properties:

| Property | Description | | --- | --- | | path | Absolute path of the file in the source tree | | base | Directory the pattern is relative to | | relative | Path relative to base. Change it to rename or move the file | | content | File content, as a Buffer or a string |

each(fn)

Creates a stream that runs fn for every file, one at a time and in order. fn receives a file and can:

  • return nothing, to keep the (possibly mutated) file
  • return a file, to replace it
  • return null, to drop it

fn can be async.

each((file) => file.relative.endsWith(".test.js") ? null : file);

all(fn)

Creates a stream that waits for all the files and gives them to fn as an array. fn returns the new array, or nothing to keep the files. Because every file is in memory at once, use it only for what really needs to see them all, like concatenating.

all((files) => files.slice(0, 10));

dest(directory)

Creates a stream that writes each file inside directory, keeping its relative path. It is the end of a pipeline.

series(...tasks) and parallel(...tasks)

Create a task that runs the given tasks one after another, or at the same time. Each item can be a task function or the name of a registered task.

License

Released under the MIT License.