Skip to content

longbill/pwait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

npm i --save pwait

Usage

async/await:

const wait = require('pwait');
async function doSomething() {
	//...
	await wait(1000); //wait 1000ms and do nothing
	//...
}

Promise:

const wait = require('pwait');
wait(1000).then(()=>{
	console.log('after 1s');
}).then(()=>wait(1000)).then(()=>{
	console.log('another 1s');
});

About

Promise based setTimeout with nothing to do

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published