@panda-clouds/promise
v0.1.0
Published
A Util lib for js promises and async/await
Downloads
2
Readme
PCPromise
maintained by PandaClouds.com
PCPromise
provides utility functions for javascript promises and async/await.
Installation
If you want to use this library, you first need to install the Node.js.
When you install node.js, will also be installed npm.
Please run the following command.
npm install --save @panda-clouds/promise
Usage
Node.js
const PCPromise = require('@panda-clouds/promise');
// example usage
async () => {
await PCPromise.wait(5000) // pauses for 5 seconds without blocking the main thread
}
You can replace PCPromise with any variable.
Methods
Unit Tests are an additional resource for learning functionality.
- wait()
Pauses execution of that thread without blocking
Example:
async () => {
await PCPromise.wait(5000) // pauses for 5 seconds without blocking the main thread
}
Contributions
Pull requests are welcome! here is a checklist to speed things up:
- modify
PCPromise.js
- add unit tests in
PCPromise.spec.js
- run
npm test
- document method in
README.md
- add your name to 'Contributors' in
README.md
Contributors
(Add your name)
- [*] Marc Smith