Socket
Socket
Sign inDemoInstall

co

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

11

examples/join.js

@@ -45,1 +45,12 @@

});
// 3 with array syntax
co(function *(){
var a = size('.gitignore');
var b = size('index.js');
var c = size('Makefile');
var res = yield [a, b, c];
console.log(res);
});
1.2.0 / 2013-06-08
==================
* add array yielding support. great suggestion by @domenic
1.1.0 / 2013-06-06

@@ -3,0 +8,0 @@ ==================

@@ -54,2 +54,7 @@

// array (join)
if (Array.isArray(ret.value)) {
ret.value = exports.join(ret.value);
}
// thunk

@@ -56,0 +61,0 @@ if ('function' == typeof ret.value) {

2

package.json
{
"name": "co",
"version": "1.1.0",
"version": "1.2.0",
"description": "generator async flow control goodness",

@@ -5,0 +5,0 @@ "keywords": ["async", "flow", "generator", "coro", "coroutine"],

@@ -10,2 +10,6 @@ # Co

Co is careful to relay any errors that occur back to the generator, including those
within the thunk, or from the thunk's callback. "Uncaught" exceptions in the generator are
then either passed `co()`'s thunk or thrown.
## Installation

@@ -20,2 +24,3 @@

- [co-fs](https://github.com/visionmedia/co-fs) - core `fs` function wrappers
- [co-exec](https://github.com/visionmedia/co-exec) - core `exec` function wrapper

@@ -274,2 +279,15 @@ ## Example

As an alias of `join(array)` you may simply `yield` an array:
```js
co(function *(){
var a = size('.gitignore');
var b = size('index.js');
var c = size('Makefile');
var res = yield [a, b, c];
console.log(res);
// => [ 13, 1687, 129 ]
});
```
## FAQ

@@ -276,0 +294,0 @@

@@ -43,1 +43,19 @@

})
describe('yield array', function(){
it('should alias yield join(array)', function(done){
co(function *(){
var a = read('index.js', 'utf8');
var b = read('Makefile', 'utf8');
var c = read('package.json', 'utf8');
var res = yield [a, b, c];
res.should.have.length(3);
res[0].should.include('exports');
res[1].should.include('test');
res[2].should.include('devDependencies');
done();
});
})
})
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