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

cls-fibers

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cls-fibers - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

lib/cls_chain.js

33

lib/index.js
// Generated by CoffeeScript 1.8.0
var Fiber,
var Fiber, FiberCLS,
__slice = [].slice;

@@ -7,16 +7,35 @@

FiberCLS = require('./fiber_cls');
module.exports = function(ns) {
var runBefore;
var runBefore, yieldBefore;
runBefore = Fiber.prototype.run;
return Fiber.prototype.run = function() {
var args, context;
Fiber.prototype.run = function() {
var args, cls;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
context = this.__cls != null ? this.__cls : this.__cls = ns.createContext();
ns.enter(context);
cls = this.__cls != null ? this.__cls : this.__cls = new FiberCLS(ns);
if (cls.yielding) {
cls.resume();
} else {
cls.run();
}
try {
return runBefore.call.apply(runBefore, [this].concat(__slice.call(args)));
} finally {
ns.exit(context);
if (!cls.yielding) {
cls.end();
delete this.__cls;
}
}
};
yieldBefore = Fiber["yield"];
return Fiber["yield"] = function() {
var args, cls, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
cls = (_ref = Fiber.current) != null ? _ref.__cls : void 0;
if (cls) {
cls["yield"]();
}
return yieldBefore.apply(null, args);
};
};
{
"name": "cls-fibers",
"version": "1.0.0",
"version": "1.1.0",
"description": "Make continuation-local-storage play nice with node-fibers.",

@@ -22,4 +22,3 @@ "author": "Good Eggs <open-source@goodeggs.com>",

"peerDependencies": {
"fibers": "*",
"continuation-local-storage": "*"
"fibers": "*"
},

@@ -31,3 +30,5 @@ "devDependencies": {

"fibers": "1.x.x",
"mocha": "1.x.x"
"mocha": "1.x.x",
"sinon": "~1.12.2",
"sinon-chai": "~2.6.0"
},

@@ -34,0 +35,0 @@ "scripts": {

# cls-fibers
Make continuation-local-storage play nice with node-fibers.
Make [continuation-local-storage](https://github.com/othiym23/node-continuation-local-storage) play nice with [node-fibers](https://github.com/laverdet/node-fibers).

@@ -5,0 +5,0 @@ [![NPM version](http://img.shields.io/npm/v/cls-fibers.svg?style=flat-square)](https://www.npmjs.org/package/cls-fibers)

Sorry, the diff of this file is not supported yet

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