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

datapipe

v0.1.0

Published

An extendable Node.js Buffer class with promised-based piping.

Readme

node-datapipe

An extendable Node.js Buffer class with promised-based piping.

This library was built to be used as a base class for node-task buffer interfaces.

API

Inherits Node.js Buffer.

constructor(source, encoding, data)

Create a Node.js Buffer with additional properties and methods.

source

An property identifying the buffer's source: filepath, url, object, etc.

encoding

String property containing buffer's encoding.

clone()

Return a clone of the instance.

content(input)

Fill buffer synchronously and return self for chaining. Input may be any Buffer, or a string which is valid for the instance's encoding.

read(opts)

Read contents of source into buffer and return a promise which resolves to self. If any additional parameters are required for loading (i.e. providing a s3 client), they can be passed in via opts. If the buffer already contains data this should immediately return a promise which resolves to self. This is a noop until extended (see node-filebuffer and node-s3buffer for examples).

write(opts)

Write contents of buffer to source and return a promise which resolves to self. If any additional parameters are required for saving (i.e. providing a s3 client, acl settings, etc), they can be passed via opts. This is a noop until extended (see node-filebuffer and node-s3buffer for examples).

pipe(method)

Load data into buffer (if not already loaded) and process it with method, yielding a promise which resolves to methods's return value.

::extend(config)

Create a new DataPipe constructor with the keys of config object assigned to its prototype. At a minimum, this should define read and write methods (see node-filebuffer and node-s3buffer for examples).

Usage

var DataPipe = require('datapipe');
var buffer = new DataPipe('path/to/source');
buffer.source; // path/to/source
buffer.content('foo'); // <Buffer 66 6f 6f>
buffer.toString(); // 'foo'
buffer.content('data').toString(); // 'data'
buffer.content(new Buffer('data')).toString(); // 'data'
buffer.content(new Buffer('64617461', 'hex')).toString(); // 'data'

var buffer = new DataPipe('path/to/source', 'hex');
buffer.content('data'); // TypeError: Invalid hex string (encoding defaults to hex)
buffer.content(new Buffer('data','utf8')).toString(); // '64617461'

var buffer = new DataPipe('path/to/source');
buffer.content('foo');
var addBar = function(buffer) {
  var input = buffer.toString();
  return buffer.content(input+" bar");
};
var addBaz = function(buffer) {
  var input = buffer.toString();
  return buffer.content(input+" baz");
}
buffer.pipe(addBar).then(addBaz).then(function(piped) {
  console.log(piped.toString()); // 'foo bar baz'
});