Socket
Socket
Sign inDemoInstall

stream-transform

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-transform - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

CHANGELOG.md

57

lib/index.js

@@ -1,5 +0,16 @@

// Generated by CoffeeScript 1.9.2
var Transformer, stream, util,
slice = [].slice;
// Generated by CoffeeScript 2.0.1
// # Stream Transformer
// Pass all elements of an array or a stream to transform, filter and add. Features include:
// * Extends the Node.js "stream.Transform" API.
// * Both synchrounous and asynchronous support based and user callback
// arguments signature.
// * Ability to skip data.
// * Sequential and concurrent execution using the "parallel" options.
// Please look at the [README], the [samples] and the [tests] for additional
// information.
var Transformer, stream, util;
stream = require('stream');

@@ -9,2 +20,11 @@

// ## Usage
// Callback approach, for ease of use:
// `transform(handler, [options])`
// Stream API, for maximum of power:
// `transform(data, [options], handler, [options], [callback])`
module.exports = function() {

@@ -88,5 +108,8 @@ var argument, callback, data, error, handler, i, j, k, len, options, result, transform, type, v;

Transformer = function(options1, transform1) {
// ## Transformer
// Options are documented [here](http://csv.adaltas.com/transform/).
Transformer = function(options1 = {}, transform1) {
var base;
this.options = options1 != null ? options1 : {};
this.options = options1;
this.transform = transform1;

@@ -121,12 +144,8 @@ this.options.objectMode = true;

}
if (l === 1) {
if (l === 1) { // sync
this._done(null, [this.transform.call(null, chunk, this.options.params)], cb);
} else if (l === 2) {
callback = (function(_this) {
return function() {
var chunks, err;
err = arguments[0], chunks = 2 <= arguments.length ? slice.call(arguments, 1) : [];
return _this._done(err, chunks, cb);
};
})(this);
} else if (l === 2) { // async
callback = (err, ...chunks) => {
return this._done(err, chunks, cb);
};
this.transform.call(null, chunk, callback, this.options.params);

@@ -137,4 +156,4 @@ } else {

return false;
} catch (_error) {
err = _error;
} catch (error1) {
err = error1;
return this._done(err);

@@ -163,3 +182,3 @@ }

if (typeof chunk === 'number') {
chunk = "" + chunk;
chunk = `${chunk}`;
}

@@ -177,1 +196,5 @@ if (chunk != null) {

};
// [readme]: https://github.com/wdavidw/node-stream-transform
// [samples]: https://github.com/wdavidw/node-stream-transform/tree/master/samples
// [tests]: https://github.com/wdavidw/node-stream-transform/tree/master/test
{
"version": "0.1.2",
"version": "0.2.0",
"name": "stream-transform",

@@ -9,3 +9,3 @@ "description": "Object transformations implementing the Node.js `stream.Transform` API",

"type": "git",
"url": "http://www.github.com/wdavidw/node-stream-transform"
"url": "http://www.github.com/adaltas/node-stream-transform"
},

@@ -15,7 +15,7 @@ "homepage": "http://csv.adaltas.com/transform/",

"devDependencies": {
"coffee-script": "latest",
"pad": "latest",
"mocha": "latest",
"csv-generate": "latest",
"should": "latest"
"coffeescript": "~2.0.1",
"pad": "~2.0.1",
"mocha": "~4.0.1",
"csv-generate": "~1.1.0",
"should": "~13.1.2"
},

@@ -27,4 +27,4 @@ "optionalDependencies": {},

"pretest": "./node_modules/.bin/coffee -b -o lib src",
"test": "NODE_ENV=test ./node_modules/.bin/mocha --compilers coffee:coffee-script/register --reporter dot"
"test": "NODE_ENV=test ./node_modules/.bin/mocha test/**/*.coffee"
}
}
}
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