Comparing version 0.2.4 to 0.2.5
@@ -1,2 +0,2 @@ | ||
var fs = require('fs'); | ||
var fs = require('fs'), path = require('path'); | ||
@@ -21,1 +21,24 @@ if (fs.statSync(process.execPath).mtime > | ||
require('./src/fibers'); | ||
// Shim child_process.spawn to shim any spawned Node instances | ||
var fibersRoot = path.dirname(require.resolve('./src/fibers')); | ||
var cp = require('child_process'); | ||
cp.spawn = function(spawn) { | ||
return function(command, args, options) { | ||
if (command === process.execPath) { | ||
options = Object.create(options || {}); | ||
options.env = Object.create(options.env || {}); | ||
options.env.FIBER_SHIM = '1'; | ||
if (process.platform === 'linux2') { | ||
options.env.LD_PRELOAD = fibersRoot + '/coroutine.so'; | ||
} else if (process.platform === 'darwin') { | ||
options.env.DYLD_INSERT_LIBRARIES = fibersRoot + '/coroutine.dylib'; | ||
options.env.DYLD_FORCE_FLAT_NAMESPACE = '1'; | ||
options.env.DYLD_LIBRARY_PATH = fibersRoot; | ||
} else { | ||
throw new Error('Unknown platform!'); | ||
} | ||
} | ||
return spawn(command, args, options); | ||
}; | ||
}(cp.spawn); |
{ | ||
"name": "fibers", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Cooperative multi-tasking for Javascript; or, the closest thing to a thread you'll see in node", | ||
@@ -5,0 +5,0 @@ "keywords": ["fiber", "fibers", "coroutine", "thread", "async", "parallel", "worker"], |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56593
40
1