https://github.com/futagoza/a2p
ES2017 async and await, as Promises
https://github.com/futagoza/a2p
async await defer es2017 promise
Last synced: 7 months ago
JSON representation
ES2017 async and await, as Promises
- Host: GitHub
- URL: https://github.com/futagoza/a2p
- Owner: futagoza
- License: other
- Created: 2017-05-02T17:34:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T00:19:26.000Z (over 8 years ago)
- Last Synced: 2025-02-09T06:42:02.347Z (8 months ago)
- Topics: async, await, defer, es2017, promise
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/futagoza/a2p)
[](https://www.npmjs.com/package/a2p)
[](https://david-dm.org/futagoza/a2p#info=devDependencies)
[](https://opensource.org/licenses/MIT)> ES2017 async and await, as Promise's
## features
A2P is a library that provides various methods that implement:
* `execute`, a function executer, faster then `Function.prototype.call`
* `attempt`, a wrapper for `try {} catch ( e ) {}`
* `Promise`, a small and fast ES2015 Promise implmentaion
* `Async`, a defered Promise
* `Await`, a smart-wrapper to always return a Promise## dist outline
* ES5 AMD: `dist/a2p-es5.amd.js`
* ES5 CommonJS: `dist/a2p-es5.commonjs.js`
* ES5 UMD: `dist/a2p-es5.umd.js`
* ES6 AMD: `dist/a2p-es6.amd.js`
* ES6 CommonJS: `dist/a2p-es6.commonjs.js`
* ES6 Module: `dist/a2p-es6.module.js`
* ES6 UMD: `dist/a2p-es6.umd.js`## installation
### npm
```bash
$ npm install a2p --save
```### bower
```bash
$ bower install a2p=futagoza/a2p --save
```## usage
### node.js
```js
// Automatically require's `a2p/dist/a2p-es5.commonjs.js` or `a2p/dist/a2p-es6.commonjs.js`.
const a2p = require( "a2p" );
```### browser (es5, global/amd)
```html
```
```js
// global
var a2p = window.a2p;// amd
define( function( require ) {var a2p = require( "a2p" );
// ...
} );
```### browser (es5, amd only)
```js
define( [ "/bower_components/a2p/dist/a2p-es5.amd.js" ], function( a2p ) {// ...
} );
```## license
Copyright © 2017 Futago-za Ryuu, [https://github.com/futagoza](https://github.com/futagoza)
Released under the MIT License, [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)