@panda-clouds/promise

0.1.0 • Public • Published

PCPromise

maintained by PandaClouds.com

PCPromise provides utility functions for javascript promises and async/await.

Installation

  1. If you want to use this library, you first need to install the Node.js.

  2. When you install node.js, will also be installed npm.

  3. 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)

Readme

Keywords

none

Package Sidebar

Install

npm i @panda-clouds/promise

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

3.94 kB

Total Files

9

Last publish

Collaborators

  • mrmarcsmith