Comparing version 2.0.2 to 3.0.0
{ | ||
"name": "fibers", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Cooperative multi-tasking for Javascript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
fibers(1) -- Fiber support for v8 and Node | ||
========================================== | ||
[![npm version](https://img.shields.io/npm/v/fibers.svg)](https://www.npmjs.com/package/fibers) [![mit license](https://img.shields.io/npm/l/fibers.svg)](https://github.com/laverdet/node-fibers/blob/master/LICENSE) [![travis build](https://img.shields.io/travis/laverdet/node-fibers/master.svg)](https://travis-ci.org/laverdet/node-fibers) [![npm downloads](https://img.shields.io/npm/dw/fibers.svg)](https://www.npmjs.com/package/fibers) | ||
[![npm version](https://badgen.now.sh/npm/v/fibers)](https://www.npmjs.com/package/fibers) | ||
[![isc license](https://badgen.now.sh/npm/license/fibers)](https://github.com/laverdet/node-fibers/blob/master/LICENSE) | ||
[![travis build](https://badgen.now.sh/travis/laverdet/node-fibers)](https://travis-ci.org/laverdet/node-fibers) | ||
[![npm downloads](https://badgen.now.sh/npm/dm/fibers)](https://www.npmjs.com/package/fibers) | ||
@@ -39,14 +42,13 @@ Fibers, sometimes called [coroutines](https://en.wikipedia.org/wiki/Coroutine), are a powerful tool which expose an API to jump between multiple call stacks from within a single thread. This can be useful to make code written for a synchronous library play nicely in an asynchronous environment. | ||
### supported platforms | ||
If you are running NodeJS version 4.x, 5.x, or 6.x on Linux, OS X, or Windows | ||
(7 or later) then you should be able to install fibers from npm just fine. If | ||
you are running an older (or newer) version of node or some other operating | ||
system you will have to compile fibers on your system. | ||
If you are running nodejs version 8.x or 10.x on Linux, OS X, or Windows (7 or later) then you | ||
should be able to install fibers from npm just fine. If you are running nodejs v6.x then you will | ||
need to use `npm install fibers@2`. For nodejs v4.x you can use `npm install fibers@1`. If you are | ||
running an older (or newer) version of node or some other operating system you will have to compile | ||
fibers on your system. | ||
(special thanks to [Jeroen Janssen](https://github.com/japj) for his work on | ||
fibers in Windows) | ||
(special thanks to [Jeroen Janssen](https://github.com/japj) for his work on fibers in Windows) | ||
If you do end up needing to compile fibers first make sure you have node-gyp | ||
installed as a global dependency (`npm install -g node-gyp`), and that you have | ||
setup your build enviroment by following the instructions at | ||
[node-gyp](https://github.com/TooTallNate/node-gyp). Ubuntu-flavored Linux users | ||
If you do end up needing to compile fibers first make sure you have node-gyp installed as a global | ||
dependency (`npm install -g node-gyp`), and that you have setup your build environment by following | ||
the instructions at [node-gyp](https://github.com/TooTallNate/node-gyp). Ubuntu-flavored Linux users | ||
may need to run `sudo apt-get install g++` as well. | ||
@@ -53,0 +55,0 @@ |
@@ -14,3 +14,5 @@ #!/usr/bin/env node | ||
var args = []; | ||
if (process.versions.modules >= 57) { | ||
if (process.versions.modules >= 57 && process.versions.modules < 59) { | ||
// Node v8 requires forcing async hook checks. In Node v9 (>=59) and beyond, | ||
// async hooks checks are on by default (and the param no longer exists). | ||
args.push('--force-async-hooks-checks'); | ||
@@ -17,0 +19,0 @@ } |
@@ -16,5 +16,11 @@ 'use strict'; | ||
run(cb) { | ||
this.emitBefore(); | ||
cb(); | ||
this.emitAfter(); | ||
// In the v8 API, only emitBefore() and emitAfter() are available | ||
if (process.versions.modules < 59) { | ||
this.emitBefore(); | ||
cb(); | ||
this.emitAfter(); | ||
} else { | ||
// In v9 and higher, emitBefore() and emitAfter() are deperecated in favor of runInAsyncScope(). | ||
this.runInAsyncScope(cb); | ||
} | ||
} | ||
@@ -21,0 +27,0 @@ } |
Sorry, the diff of this file is not supported yet
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
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
1465735
1066
599
49