项目作者: futagoza

项目描述 :
ES2017 async and await, as Promises
高级语言:
项目地址: git://github.com/futagoza/a2p.git
创建时间: 2017-05-02T17:34:07Z
项目社区:https://github.com/futagoza/a2p

开源协议:Other

下载


Build status
npm version
devDependencies
License

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

  1. $ npm install a2p --save

bower

  1. $ bower install a2p=futagoza/a2p --save

usage

node.js

  1. // Automatically require's `a2p/dist/a2p-es5.commonjs.js` or `a2p/dist/a2p-es6.commonjs.js`.
  2. const a2p = require( "a2p" );

browser (es5, global/amd)

  1. <script src="bower_components/a2p/dist/a2p-es5.umd.js"></script>
  1. // global
  2. var a2p = window.a2p;
  3. // amd
  4. define( function( require ) {
  5. var a2p = require( "a2p" );
  6. // ...
  7. } );

browser (es5, amd only)

  1. define( [ "/bower_components/a2p/dist/a2p-es5.amd.js" ], function( a2p ) {
  2. // ...
  3. } );

license

Copyright © 2017 Futago-za Ryuu, https://github.com/futagoza

Released under the MIT License, http://opensource.org/licenses/MIT