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

genericrunner

v2.10.8

Published

A generic purpose task runner

Readme

genericrunner

A generic task runner

Usage:

This is a example to get all input in the page by using the genericrunner

import {Engine, buildFlowFromConfig} from 'genericrunner';
let flowConfig = {
    id: 'flow', // id is a unique string
    type: 'flow', // means this is a flow node
    nodes: [
        // start node
        {
            id: '0',
            type: 'ready',
            name: 'ready'
        },
        // we initial the chrome headless mode
        {
            id: '1',
            type: 'launchchrome',
            options: {
                port: 9222
            },
            name: 'init chrome headless'
        },
        // open a page
        {
            id: '2',
            type: 'openpage',
            options: {
                url: 'http://www.xxx.com'
            },
            name: 'open baidu'
        },
        // transform node is for data transform
        // we get chrome instance from prev node result
        {
            id: '3',
            type: 'transform',
            options: {
                code: 'return arguments[0].chrome;'
            },
            name: 'get chrome from {chrome, network}'
        },
        // get all input from the page
        {
            id: '4',
            type: 'dom',
            options: {
                selector: 'input'
            },
            name: 'get dom'
        }
    ],
    links: [
        {
            type: 'link',
            fromId: '0',
            fromPort: 0,
            toId: '1',
            toPort: 0
        },
        {
            type: 'link',
            fromId: '1',
            fromPort:0, 
            toId: '2',
            toPort: 0
        },
        {
            type: 'link',
            fromId: '2',
            fromPort: 0,
            toId: '3',
            toPort: 0
        },
        {
            type: 'link',
            fromId: '3',
            fromPort: 0,
            toId: '4',
            toPort: 0
        }
    ]
}
let flow = buildFlowFromConfig(flowConfig);
let engine = new Engine(flow);
await engine.run();
console.log('done');

nodes:

ready: start node
dom: get dom from page
launchchrome: initial a headless chrome with a blank page
openpage: open a page in headless chrome, return network & dom modules
shell: execute a shell command, hold the process util command executed
transform: when the input & output requires diffrent struct of data, please use transform to adapt
There will be more~

How can I extends more kinds of node?

very easy:

import {
    addCustomNodeSeachPath,
    Node,
    ReturnValue
} from 'genericrunner';

// the path where you node placed; 
addCustomNodeSeachPath('xxx');
export default class MyNode extends Node {
    name = 'myNode';

    // The type is exactly the same with your filename,
    // genericrunner find your node by filename, so don't make it diffrent 
    static type = 'myNode';

    async exec(param) {
        super.exec(param);
        // custom options
        let {xxx, yyy} = this.options;
        // do what you want
        let ret = 'ret';
        // and return a ReturnValue instance
        return new ReturnValue(0, ret, this);
    }
}

another way

publish your own npm

git clone https://github.com/li-yinan/generic-runner-plugin-example modify package.json rename these code

{
    "name": "generic-runner-plugin-xxx",
    "description": "xxx",
    "version": "xxx",
    "author": "xxx"
}

then npm publish