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

@cognipipe/core

v0.4.1

Published

Core workflow execution engine for CogniPipe

Readme

@cognipipe/core

The workflow engine behind CogniPipe: parse a workflow file, validate it, and execute its steps through registered nodes.

Requires Node.js >= 22.14. Ships ESM and CommonJS builds.

Install

npm install @cognipipe/core @cognipipe/node-http
# or: pnpm add @cognipipe/core @cognipipe/node-http

Quick start

import { WorkflowParser, WorkflowValidator, NodeRegistry, WorkflowExecutor } from '@cognipipe/core';
import { HttpNode } from '@cognipipe/node-http';

const registry = new NodeRegistry();
registry.register('@cognipipe/node-http', HttpNode);

const raw = await new WorkflowParser().parseFile('./workflow.yaml'); // .yaml, .yml or .json
const config = new WorkflowValidator().validate(raw); // throws CogniPipeError if invalid

const { context, stepErrors } = await new WorkflowExecutor(registry).run(config);
console.log(context.get('steps')); // { [stepName]: { output, completedAt, durationMs, retryCount } }
# workflow.yaml
name: fetch-and-report
version: '1.0.0'
steps:
  - name: fetch-data
    uses: '@cognipipe/node-http'
    config:
      url: 'https://catfact.ninja/fact'

  - name: report
    uses: '@cognipipe/node-http'
    dependsOn: ['fetch-data'] # required to read fetch-data's output
    config:
      url: 'https://example.com/hook'
      method: POST
      body: '{{ steps.fetch-data.output.body }}'

How execution works

  • Every step's uses must be registered before anything runs; a typo never leaves earlier steps half-applied.
  • Cycles in dependsOn are rejected up front (CIRCULAR_DEPENDENCY).
  • Steps run as a DAG: a step with no unmet dependsOn starts immediately, concurrently with other ready steps. A step that reads another step's output with {{ steps.<name>.output.<path> }} must list that step in dependsOn.
  • continueOnError: true records the failure in stepErrors and keeps going. Other failures throw STEP_EXECUTION_FAILED.
  • retry: { attempts, delayMs, backoff } retries a step's execute() (linear or exponential backoff).
  • {{ ... }} expressions in a step's config are resolved before the node runs. Objects and arrays are inserted as JSON.

API

| Export | Purpose | | --------------------------------------------------------------- | ---------------------------------------------------- | | WorkflowParser | parseFile, parseYAML, parseJSON → unknown | | WorkflowValidator | validate(raw) → typed WorkflowConfig | | NodeRegistry | register, get, has, instantiate, listTypes | | WorkflowExecutor | run(config, initial?) → { context, stepErrors } | | ExecutionContext | Immutable key/value store with interpolate() | | resolveTemplate, resolveDotPath | Interpolation utilities | | detectCycles | Cycle detection for dependsOn graphs | | WorkflowConfigSchema, StepConfigSchema, RetryConfigSchema | Zod schemas | | CogniPipeError, isCogniPipeError, COGNIPIPE_ERROR_CODES | Error handling |

Errors

Every error is a CogniPipeError with a machine-readable code and optional context:

import { isCogniPipeError } from '@cognipipe/core';

try {
  await executor.run(config);
} catch (err) {
  if (isCogniPipeError(err)) console.error(`[${err.code}] ${err.message}`, err.context);
  else throw err;
}

Codes: WORKFLOW_VALIDATION_ERROR, WORKFLOW_PARSE_ERROR, STEP_NOT_FOUND, NODE_NOT_REGISTERED, STEP_EXECUTION_FAILED, CIRCULAR_DEPENDENCY, INTERPOLATION_ERROR, CONTEXT_KEY_NOT_FOUND, NODE_INSTANTIATION_FAILED, NODE_CONFIG_INVALID.

Related packages

@cognipipe/types · @cognipipe/sdk · cognipipe (CLI)

License

MIT © Aakif Kohari