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

yielding

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yielding - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

examples/parallel.js

0

examples/ncall.js

@@ -0,0 +0,0 @@ var Y = require('..');

@@ -0,0 +0,0 @@ var fs = require('fs');

@@ -0,0 +0,0 @@ var fs = require('fs');

@@ -0,0 +0,0 @@ var Y = require('..');

@@ -0,0 +0,0 @@ var Y = require('..');

@@ -0,0 +0,0 @@ var Y = require('..');

@@ -0,0 +0,0 @@ var q = require('q');

@@ -0,0 +0,0 @@ var fs = require('fs');

@@ -0,0 +0,0 @@ var Y = require('..');

@@ -0,0 +0,0 @@ module.exports = Y;

2

package.json
{
"name": "yielding",
"version": "0.1.5",
"version": "0.1.6",
"description": "Easy generators",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -33,4 +33,16 @@ yielding

```
### Async code:
### Parallel execution
```js
var get = Y.nwrap( require('request').get );
Y(function* () {
var pages = ['http://google.com', 'http://yahoo.com', 'http://bind.com'];
var content = yield pages.map(function(url) {
return get(url);
});
console.log(content.map(function(c) { return c.body.length; }));
})();
```
### Async code with wrapper for node functions
```js
var read = Y.nwrap(fs.readFile);

@@ -68,13 +80,2 @@

```
### Wrap node functions
```js
var read = Y.nwrap(fs.readFile);
function* getContent(filename) {
var content = yield read(filename, 'utf-8');
console.log(content.length);
};
Y(getContent)('./examples/Y.js');
```
###Error handling

@@ -91,1 +92,2 @@ ```js

```
[See more examples](https://github.com/mikach/yielding/tree/master/examples)

@@ -0,0 +0,0 @@ var Y = require('..');

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