Socket
Socket
Sign inDemoInstall

worker-farm

Package Overview
Dependencies
3
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

13

lib/child/index.js

@@ -18,9 +18,12 @@ var $module

if (_args[0] instanceof Error) {
var e = _args[0]
_args[0] = {
'$error' : '$error'
, 'type' : _args[0].constructor.name
, 'message' : _args[0].message
, 'stack' : _args[0].stack
, 'data' : _args[0].data
, 'type' : e.constructor.name
, 'message' : e.message
, 'stack' : e.stack
}
Object.keys(e).forEach(function(key) {
_args[0][key] = e[key]
})
}

@@ -46,2 +49,2 @@ process.send({ idx: idx, child: child, args: _args })

handle(data)
})
})
{
"name": "worker-farm",
"description": "Distribute processing tasks to child processes with an über-simple API and baked-in durability & custom concurrency options.",
"version": "1.3.0",
"version": "1.3.1",
"homepage": "https://github.com/rvagg/node-worker-farm",

@@ -6,0 +6,0 @@ "authors": [

@@ -26,3 +26,5 @@ var fs = require('fs')

var err = new Error(message)
err.data = data
Object.keys(data).forEach(function(key) {
err[key] = data[key]
})
callback(err)

@@ -29,0 +31,0 @@ return

@@ -362,3 +362,3 @@ var tape = require('tape')

tape('test error passing', function (t) {
t.plan(9)
t.plan(10)

@@ -376,5 +376,6 @@ var child = workerFarm(childPath, [ 'err' ])

})
child.err('Error', 'this is an Error with data', {foo: 'bar'}, function (err) {
child.err('Error', 'this is an Error with custom props', {foo: 'bar', 'baz': 1}, function (err) {
t.ok(err instanceof Error, 'is an Error object')
t.deepEqual(err.data, {foo: 'bar'}, 'passes data')
t.equal(err.foo, 'bar', 'passes data')
t.equal(err.baz, 1, 'passes data')
})

@@ -381,0 +382,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc