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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tobrut.js

v1.2.1

Published

Turbulent Object Builder Ready Using Taskflows - A modern async workflow library for Node.js

Readme

tobrut.js - Turbulent Object Builder Ready Using Taskflows

tobrut.js is a modern Node.js library for creating and running asynchronous workflows in a fast and efficient way. This library is designed to build complex objects dynamically through a series of tasks that can be executed sequentially or in parallel.

Installation

npm install tobrut.js

Basic Usage

const TurbulentBuilder = require('tobrut.js');

// Creating taskflows
const userDataTask = async (currentObj) => {
    // Do something with currentObj
    return { userId: 123, username: 'example' };
};

const processingTask = async (currentObj) => {
    // Do further processing
    return { processed: true };
};

// Running taskflows
const result = await new TurbulentBuilder({ initial: 'data' })
    .addTask('Fetch Data', userDataTask)
    .addTask('Process Data', processingTask)
    .run();

console.log(result); // { initial: 'data', userId: 123, username: 'example', processed: true }

Main Features

1. Sequential and Parallel Taskflows

  • addTask(name, taskFn): Adds a task that runs sequentially
  • addParallelTask(name, taskFn): Adds a task that runs in parallel with other tasks
  • addConditionalTask(name, taskFn, condition): Adds a task that only runs if a condition is met

2. Configuration Options

  • setOptions({ verbose, failFast, maxRetries }): Configure the builder behavior
    • verbose: Show detailed logging (default: false)
    • failFast: Stop when there's an error (default: true)
    • maxRetries: Maximum number of retries for failed tasks (default: 0)

3. Error Handling and Retry

  • failFast option to control whether the flow should stop when there's an error
  • Support for automatic retry by specifying the number of retries per task

4. Chaining

  • Supports method chaining to create clean and readable workflow definitions

Complete Example

const TurbulentBuilder = require('tobrut.js');

async function runExample() {
    const result = await new TurbulentBuilder({ input: 'data' })
        .setOptions({ 
            verbose: true, 
            failFast: false, 
            maxRetries: 2 
        })
        .addTask('Fetch Data', async (obj) => {
            return { userId: 42, username: 'user' };
        })
        .addTask('Validate Data', async (obj) => {
            return { validated: true };
        })
        .addConditionalTask('Optional Task', async (obj) => {
            return { optional: 'data' };
        }, (obj) => obj.userId === 42)
        .addTask('Process Data', async (obj) => {
            return { processed: true };
        })
        .addParallelTask('Parallel Process 1', async (obj) => {
            return { parallel1: 'done' };
        })
        .addParallelTask('Parallel Process 2', async (obj) => {
            return { parallel2: 'done' };
        })
        .run();
    
    console.log(result);
}

runExample();

Use Cases

tobrut.js is perfect for:

  • Data processing pipelines
  • Complex API integrations
  • Automation workflows
  • AI/machine learning data processing
  • ETL (Extract, Transform, Load) systems
  • Data validation and transformation flows

API

new TurbulentBuilder(initialObject = {})

Creates a new instance of TurbulentBuilder with an optional initial object.

addTask(name, taskFn, opts = {})

Adds a sequential task to the flow.

addParallelTask(name, taskFn, opts = {})

Adds a parallel task to the flow.

addConditionalTask(name, taskFn, condition)

Adds a conditional task that only runs if the condition function returns true.

setOptions(opts)

Configures options for the builder.

run()

Runs all taskflows and returns a Promise of the final object result.

Advanced Features

Automatic Retry

You can specify retry attempts for specific tasks:

.addTask('Unstable Task', unreliableTask, { retry: 3 })

Validation and Logging

Enable detailed logging and validation settings with:

.setOptions({ verbose: true })

Contributing

Contributions are welcome! Please create an issue or pull request in our repository.

License

MIT