Socket
Socket
Sign inDemoInstall

into-stream

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

into-stream - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

16

index.js
'use strict';
var from = require('from2');
const from = require('from2');
module.exports = function (x) {
module.exports = x => {
if (Array.isArray(x)) {

@@ -9,3 +9,3 @@ x = x.slice();

return from(function (size, cb) {
return from((size, cb) => {
if (x.length === 0) {

@@ -21,9 +21,10 @@ cb(null, null);

var chunk = x.slice(0, size);
const chunk = x.slice(0, size);
x = x.slice(size);
cb(null, chunk);
setImmediate(cb, null, chunk);
});
};
module.exports.obj = function (x) {
module.exports.obj = x => {
if (Array.isArray(x)) {

@@ -45,4 +46,5 @@ x = x.slice();

this.push(x);
cb(null, null);
setImmediate(cb, null, null);
});
};
{
"name": "into-stream",
"version": "2.0.1",
"version": "3.0.0",
"description": "Convert a buffer/string/array/object into a stream",

@@ -13,3 +13,3 @@ "license": "MIT",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -45,5 +45,5 @@ "scripts": {

"buffer-equals": "^1.0.3",
"concat-stream": "^1.4.8",
"get-stream": "^2.1.0",
"xo": "*"
}
}

@@ -29,3 +29,3 @@ # into-stream [![Build Status](https://travis-ci.org/sindresorhus/into-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/into-stream)

Type: `buffer` `string` `array<buffer|string>`<br>
Type: `Buffer` `string` `Array<Buffer|string>`<br>
Returns: [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable)

@@ -32,0 +32,0 @@

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