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

noria

v1.1.2

Published

A collection of utilities and Classes for working with Node.js streams

Downloads

16

Readme

Noria

NPM version License Build Status Coverage Status Dependency Status

DEPRECATED: This package is no longer maintained

A collection of utilities for working with Node.js streams.

Installation

Install via npm:

npm install noria

API

collect([encoding], [objectMode], callback, [options])

  • encoding String (optional) - alias for options.encoding.
  • objectMode Boolean (optional) - alias for options.objectMode.
  • callback Function - Called after all data has been collected. Takes one data parameter.
  • options Object (optional) - Options passed to the stream.

Returns a new Transform stream that buffers all incoming data and then calls callback(data). Or, if objectMode is true, data will be an array containing each object that has passed through. If encoding is defined, data will be converted to a string before it is passed to callback. The options parameter is identical to that of Node's Transform stream constructor.

The following will print the contents of a file to the console before writing it to a new location.

fs.createReadStream('liftoff-file.txt')
    .pipe(noria.collect('utf8', function(data) {
        console.log(data);
    }))
    .pipe(fs.createWriteStrem('landing-file.txt'));

init(data, [options])

  • data - The data to pass to the stream.
  • options Object (optional) - Options to pass to the stream.

Returns a new Readable stream initialized with some arbitrary data. If data is an array, each element in the array will be treated as a chunk of data. options.objectMode is true by default. The options parameter is identical that of Node's Readable stream constructor.

// Initializes with one chunk of type String.
noria.init('Colorless green ideas sleep furiously.');

// Initializes with three chunks of various types.
noria.init([42, 'than', {name: 'adams'}]);

// Initializes with one chunk of type Array.
noria.init([['the', 'universe']]);

wrap([prefix], [suffix], [options])

  • prefix Buffer | String (optional) - Data to prepend to the beginning of the stream.
  • suffix Buffer | String (optional) - Data to append to the end of the stream.
  • options Object (optional) - Options to pass to the stream.

Returns a new Transform stream that wraps the contents of a stream with an arbitrary prefix and suffix. Either can be omitted by passing null or by leaving the argument undefined. The options parameter is identical to that of Node's Transform stream constructor.

const fs = require('fs');

fs.createReadStream('elfish-ge.txt')
    // Contents: ' are the master programmers, and they '
    .pipe(noria.wrap(
        'The genes',
        'are programming for their lives.'
    )).pipe(process.stdout);

// Prints: 'The genes are the master programmers,
// and they are programming for their lives.'

License

Copyright © 2015 Akim McMath. Licensed under the MIT License.