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 🙏

© 2024 – Pkg Stats / Ryan Hefner

paipu

v1.0.9

Published

Yet another pipe library for Node :rocket:

Downloads

20

Readme

paipu

Piapue is Japanese for Pipe, and it's also pipes library for Node.

Install

npm i paipu

Usage

You can throw anything into the pipe:

  • Functions and Promises will be evaluated and the result will be the context for the next pipe
  • Other pipes will extend the current pipe
  • Anything else will set the context for the rest of the pipe

To execute a pipe, call resolve() at the end of it.

Examples

Simple pipe:

const paipu = require('paipu');

const result = 
	await paipu
		.pipe('hello')
		.pipe(context => context.substr(0, 4))
		.resolve();

// Result = 'hell'

Pipe with promises:

const  paipu  =  require('paipu');

const  result  =
	await paipu
		.pipe('abcdefg')
		.pipe(async context => context.substr(0, 3))
		.resolve();

// Result = 'hell'

Pipe with nested pipes:

const paipu = require('paipu');

const encrypt =  
	paipu
		.pipe(context => context.replace('a', 'b'))
		.pipe(context => context.replace('c', 'd'))
  

const result =
	await paipu
		.pipe('abcdefg')
		.pipe(encrypt)
		.resolve();
		
// Result = 'bbddefg'

There are also before/after pipe hooks and aliases:

const paipu = require('paipu');

paipu
	.beforePipe((alias, context) => console.log(`executing '${alias}'...`))
	.afterPipe((alias, context) => console.log(`'${alias}' has finished!`))
	.pipe('throw in a string', 'abcdefg')
	.pipe('cut that goddamn string', async context => context.substr(0, 3))
	.resolve();

And they will effect nested pipes too!

Contribution

Any type of feedback, pull request or issue is welcome