Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-stream

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-stream - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

24

lib/modifiers/parse.js

@@ -11,3 +11,8 @@ var map = require('./map.js');

*
* @returns {Stream} - Transform stream.
* @param {Object} [options] - Options to use when parsing items in the stream.
* @param {Boolean} [options.error = true] - If true, an error caught when parsing JSON
* will be emitted on the stream. If false, the
* unparseable item will be removed from the stream
* without error.
* @returns {Stream} - Transform stream.
*

@@ -27,4 +32,12 @@ * @example

*/
function parse() {
function parse(options) {
var settings = {
error: true
};
// Only accept booleans
if (options && (options.error === true || options.error === false)) {
settings.error = options.error;
}
return map(function (chunk, next) {

@@ -36,3 +49,8 @@ var parsed;

} catch (e) {
return next(e);
if (settings.error) {
return next(e);
}
return next();
}

@@ -39,0 +57,0 @@

2

package.json
{
"name": "node-stream",
"version": "1.1.0",
"version": "1.2.0",
"description": "Utilities for consuming, creating and manipulating node streams.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -14,3 +14,3 @@ # Node-Stream

A small collection of stream consumers.
A small collection of array-like methods for working with streams.

@@ -17,0 +17,0 @@ ## Install

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