JSPM

reads

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q51978F
  • License MIT

Transform all the data to a readable stream

Package Exports

  • reads

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reads) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

reads

Transform all of your inputs to a Readable stream. Wrap all the things! It currently transforms:

  • Strings, assumes they are file paths and returns fs.createReadableStream
  • Buffers, transformed to a new "Buffered" Readable stream.
  • Stream, just returns all the things.
npm install --save reads

Usage

A single function is exposed which accepts a string, buffer or stream as first argument and Stream options as a second argument. It always returns a ReadableStream as result:

'use strict';

var reads = require('reads')
  , stream;

stream = reads('/path/toa/file.js');
stream = reads(new Buffer('foo bar'));

License

MIT