Socket
Socket
Sign inDemoInstall

noria

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

noria

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


Version published
Maintainers
1
Created
Source

Noria

NPM version License Build Status Dependency Status

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

Installation

Install via npm:

npm install noria

API

init(data, [options])
  • data Buffer | String | Object - 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. The options parameter is identical that of Node's Readable stream constructor. To pass an Object as the data argument, ensure that you set objectMode: true.

const noria = require('noria');

noria.init('Colorless green ideas sleep furiously.')
    .pipe(process.stdout)

// Prints: 'Colorless green ideas sleep furiously.'
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 noria = require('noria');
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.

Keywords

FAQs

Package last updated on 21 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc