Install delay module and compile from Typescript source.
This commit is contained in:
parent
7cc03a2e8d
commit
f99290d6ce
|
@ -0,0 +1,15 @@
|
|||
'use strict';
|
||||
/**
|
||||
* Delay in an async/await function
|
||||
*
|
||||
* @param {integer} ms Milliseconds to delay for
|
||||
*
|
||||
* @returns {Promise} Promise to resolve after timeout
|
||||
**/
|
||||
function delay(ms) {
|
||||
return new Promise((resolve) => {
|
||||
return setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
module.exports.delay = delay;
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delay/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;IAMI;AAEJ,SAAS,KAAK,CAAE,EAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAa,EAAE,EAAE;QACpC,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "delay",
|
||||
"version": "0.0.1",
|
||||
"description": "Promise-based setTimeout wrapper function",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "sixteenmillimeter",
|
||||
"license": "MIT"
|
||||
}
|
Loading…
Reference in New Issue