@lvchengbin/promise

1.1.7 • Public • Published

Promise

Promise implementation conforming the Promises/A+ for browsers.

Installation

$ npm i @lvchengbin/promise --save

Usage

NodeJS

const Promise = require( '@lvchengbin/promise' );

ES6

import Promise from '@lvchengbin/promise';

Using in Browsers

If you want to invoke the JavaScript file to browser directly, you can use promise.js. For old browsers which are not support ES5, you should use promise.bc.js.

<script src="./promise.bc.js"></script> 
<script>
    new Promise( function( resolve ) {
        setTimeout( function() {
            resolve( 100 );
        }, 1000 );
    } ).then( function( value ) {
        console.log( value );
    } );
</script>

Readme

Keywords

Package Sidebar

Install

npm i @lvchengbin/promise

Weekly Downloads

0

Version

1.1.7

License

MIT

Unpacked Size

32.8 kB

Total Files

8

Last publish

Collaborators

  • lvchengbin