You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 965B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # into-stream [![Build Status](https://travis-ci.org/sindresorhus/into-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/into-stream)
  2. > Convert a buffer/string/array/object/iterable/promise into a stream
  3. Correctly chunks up the input and handles backpressure.
  4. ## Install
  5. ```
  6. $ npm install --save into-stream
  7. ```
  8. ## Usage
  9. ```js
  10. const intoStream = require('into-stream');
  11. intoStream('unicorn').pipe(process.stdout);
  12. //=> 'unicorn'
  13. ```
  14. ## API
  15. ### intoStream(input)
  16. Type: `Buffer` `string` `Iterable<Buffer|string>` `Promise`<br>
  17. Returns: [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable)
  18. Adheres to the requested chunk size, except for `array` where each element will be a chunk.
  19. ### intoStream.obj(input)
  20. Type: `Object`, `Iterable<Object>` `Promise`<br>
  21. Returns: [Readable object stream](https://nodejs.org/api/stream.html#stream_object_mode)
  22. ## License
  23. MIT © [Sindre Sorhus](https://sindresorhus.com)