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

taskflow.js

v1.0.2

Published

TaskFlow is a Node.js tool that allows developers to define **high-level task pipelines** using simple, readable steps, then automatically **compile and execute** them as real JavaScript code.

Readme

TaskFlow

TaskFlow is a Node.js tool that allows developers to define high-level task pipelines using simple, readable steps, then automatically compile and execute them as real JavaScript code.

It supports both:

  • 📦 Library usage (from JavaScript code)
  • 🧰 CLI usage (from the terminal)

TaskFlow is designed for automation, experimentation, and educational purposes.


Features

  • Define pipelines using readable .then("step description") chains
  • Automatically generate executable JavaScript code
  • Preserve all non-pipeline code exactly as-is
  • Run pipelines sequentially with clear logging
  • CLI support (taskflow run <file>)
  • Graceful fallback when OpenAI is unavailable (Mock Mode)
  • ES Modules support

Installation

Local / Project Install

npm install taskflow.js

Global Install (CLI)

npm install -g taskflow.js

CLI Usage

Create a JavaScript file that contains TaskFlow pipelines. Example: userApp.js

import { Task } from "taskflow.js";

const userEmail = "[email protected]";
const subject = "Welcome!";
const messageText = "Hello from TaskFlow 👋";

const emailFlow = Task("Email Notification")
  .then("Create an email content using userEmail, subject, and messageText")
  .then("Print the email content to the console")
  .then("Print a confirmation message that the email is 'sent'");

Run the file using the CLI:

taskflow run userApp.js

TaskFlow will:

  • Analyze the pipelines
  • Generate executable JavaScript code
  • Compile the file into a .compiled.js file
  • Execute the compiled output

Library Usage

You can also use TaskFlow programmatically from another script. Example: run.js

import { compileAndRunPipeline } from "taskflow.js";

const result = await compileAndRunPipeline("./userApp.js");

if (!result.ok) {
  console.error(result.error);
  process.exit(1);
}

console.log("Compiled file:", result.data.compiledPath);
console.log(result.data.runOutput.stdout);

Run it with:

node run.js

Output

After execution, TaskFlow returns:

  • The path to the compiled file
  • The runtime output (stdout, stderr, exitCode)

Mock Mode (OpenAI Fallback)

If OpenAI is unavailable (missing API key, quota exceeded, or connection issues), TaskFlow automatically switches to Mock Mode.

In Mock Mode:

  • A deterministic JavaScript block is generated
  • The full compile → run flow is preserved
  • The system continues to work for demos and testing
  • The CLI indicates when Mock Mode is used.

Environment Variables

TaskFlow uses the following environment variables:

  • OPENAI_API_KEY – Your OpenAI API key
  • OPENAI_MODEL – Optional model name (default: gpt-4o-mini) These can be defined in a .env file or directly in the system environment.

Requirements

-Node.js 18+ -ES Modules

Notes

  • demo/ folder is for development only
  • .env is not included in the package