New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

ompipe

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ompipe

light and useful pipeline manager tool for nodejs

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ompipe 🚀

Node.js Pipeline License Version

Light and useful pipeline manager tool for Node.js

Features ✨

  • Simple and intuitive API
  • Lightweight with zero dependencies
  • Supports parallel and sequential execution
  • Easy error handling and recovery
  • Fully typed with TypeScript support

Installation

npm install ompipe

Usage

import { OmPipe } from "ompipe";

const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

async function main() {
    const pipe = new OmPipe('test');
    
    pipe.add('compile', async (ctx) => {
        await sleep(1000);
        // return value will be stored in context persistantly
        return 'hello world';

        // tag this task as critical, if it fails, the pipeline will be stopped
    }, { critical: true });

    pipe.add('print something', async (ctx) => {
        // you can get the result of history task by using ctx.getTaskResult(taskName)
        // even if it has been executed in the past
        const res = ctx.getTaskResult('compile');
        // this res is "hello world"
        await sleep(1000);
    });

    await pipe.start();

    console.log('pipeline end');
}

main();

when you run code above first time, you will receive this output:

→ execute compile ...
→ execute print something ...
pipeline end

when you run code again, you will receive this output:

✓ task (compile) is success executed at 2025/6/3 19:00:53, skip
✓ task (print something) is success executed at 2025/6/3 19:00:54, skip
pipeline end

All the state during task execution will be stored in .pipeline.

FAQs

Package last updated on 03 Jun 2025

Related posts