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

qpipejs

v2.0.0

Published

## welcome to heaven

Readme

qpipejs

welcome to heaven

qpipejs is designed to help you to write kiss code.

It is built uppon the concepts of glocal and tasks.

how code looks like

var qpipejs = require('qpipejs')

qpipe = qpipejs({
  foo: 'foo',
  bar: 'bar'
})
.do(someTask)
.do(otherTask)
.do(thisOneFails, firstFallbackTask, secondFallbackTask, andSoOn)

You do not need to care whether your tasks are synchronous or asynchronous, promises or callbacked functions.

methods

qpipejs([glocal[, options]])

  • glocal is the object to be this of every task
  • options is an object with some options, currently only fail

Returns a Qpipe Object

var qpipejs = require('qpipejs')

var qpipe = qpipejs({
  foo: 'foo',
  bar: 'bar'
}, {
  fail: function (error) {
    console.log(error)
  }
})

qpipejs.use

It is a helper to be used in express

When you do app.use(qpipe.use) or router.use(qpipe.use) the res parameter will be populated with a qpipejs function that returns a Qpipe object with some sugar.

qpipe.do(task[, fallback, ...])

Executes task, passing glocal as this If tasks fails, then executes the next fallback If there is no more fallbaks the qpipe fails and options.fail is executed

var qpipejs = require('qpipejs')

qpipe = qpipejs(glocal)
.do(someTask)
.do(otherTask)
.do(thisOneFails, firstFallbackTask, secondFallbackTask, andSoOn)

The tasks are called with task.call(glocal, resolve, reject)

If the task returns resolve, it waits until resolve (or reject) is called If the task returns a promise, it waits until the promise is resolved or rejected If the task returns anything else, the next task is executed.

If the current task throw an exception, calls reject or reject the promise that it has returned, the next fallback task in the same do is executed.

qpipe.each(array, callback)

If array is an Array, execute callback.call(glocal, element, resolve, reject) for each element in array

If array is an Array, execute callback.call(glocal, element, resolve, reject) for each element in glocal[array]

qpipe.all(task, task, ...)

It executes all tasks like that task.call(glocal, resolve, reject) and waits until every one is resolved, or anyone is rejected.

qpipe.race(task, task, ...)

It executes all tasks like that task.call(glocal, resolve, reject) and waits until anyone is resolved or rejected.

qpipe.wait()

It returns the promise at that point. It is the same that qpipe.promise

qpipe.response('foo', 'bar', ...)

Express sugar It response the request with a object that has the keys passed as arguments, and theirs values on the glocal.

If 'status' is passed, it set the glocal.status status

qpipe.ok()

Express sugar It response the request with {"ok": true} and status 200

attributes

qpipe.glocal

It is the object that is passed to every task executed by the qpipe

qpipe.options

It is the object with the options passed.

currently only fail is used

qpipe.options.fail(error)

It is called when any task throw an exception or rejects

If you do not set your own fail function, the default ones are called.

In express: it response the request with status 500 (or error.status) and the json of the error

promise

It is the promise of the last Qpipe method called. Not of the task called.