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

aa

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aa - npm Package Compare versions

Comparing version 0.1.22 to 0.1.23

4

package.json
{
"name": "aa",
"version": "0.1.22",
"description": "aa - Async-Await. co like library, go like channel, thunkify or promisefy wrap package",
"version": "0.1.23",
"description": "aa - async-await. co like library, go like channel, thunkify or promisify wrap package.",
"main": "aa.js",

@@ -6,0 +6,0 @@ "dependencies": {

[aa](https://www.npmjs.com/package/aa) - [async-await](https://www.npmjs.com/package/async-await)
====
[aa](https://www.npmjs.com/package/aa) - [async-await](https://www.npmjs.com/package/async-await) library.<br/>
co like library, go like channel, thunkify or promisefy wrap package.
[aa](https://www.npmjs.com/package/aa) - [async-await](https://www.npmjs.com/package/async-await)
====
[aa](https://www.npmjs.com/package/aa) - [async-await](https://www.npmjs.com/package/async-await) library. <br>
co like library, go like channel, thunkify or promisify wrap package.
using ES6 (ES2015) generator function.

@@ -16,5 +19,5 @@

```bash
$ npm install aa
$ npm install aa --save
or
$ npm install async-await
$ npm install async-await --save
```

@@ -41,2 +44,67 @@

### aa(generator or generator function) : returns promise (thunkified promise)
basic usage. <br>
you can `aa()` promises, generators, and generator functions.
```js
aa(function *() {
// *** SEQUENTIAL EXECUTION ***
// yield value returns itself
yiled 1;
yiled [1, 2, 3];
yiled {x:1, y:2, z:3};
// yield promise returns resolved value
yield Promise.resolve(1);
// or throws rejected error
try { yield Promise.reject(new Error('expected')); }
catch (e) { console.error('%s', e); }
// *** PARALLEL EXECUTION ***
// yield an array of promises waits all promises and returns resolved array
yield [Promise.resolve(1), Promise.resolve(2)];
// yield an object of promises waits all promises and returns resolved object
yield {x: Promise.resolve(1), y: Promise.resolve(2)};
// *** OTHERS AND COMBINED OPERATIONS ***
// yield thunk
// yield generator or generator function
// yield channel for event stream
});
```
### aa.promisify(node style function) : function returns promise
`promisify()` converts node style function into a function returns promise. <br>
you can use `fs.exists()` and `child_process.exec()` also.
### aa.thunkify(node style function) : function returns thunk
`thunkify()` converts node style function into a thunkified function. <br>
you can use `fs.exists()` and `child_process.exec()` also.
### aa.Channel() : new channel for event stream
`Channel()` returns a new channel for event stream. <br>
use a channel for node style function as a callback. <br>
yield channel for wait it. <br>
### yield : waits and returns resolved value.
you can `yield` promises, thunkified functions,
generators, generator functions,
primitive values, arrays, and objects. <br>
EXAMPLES:
----
### Example 1 sequential: [aa-readme-ex01-seq.js](examples/aa-readme-ex01-seq.js#readme)

@@ -43,0 +111,0 @@

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