Install delay module and compile from Typescript source.

This commit is contained in:
mmcwilliams 2019-10-11 17:54:29 -04:00
parent 7cc03a2e8d
commit f99290d6ce
3 changed files with 27 additions and 0 deletions

15
lib/delay/index.js Normal file
View File

@ -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

1
lib/delay/index.js.map Normal file
View File

@ -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"}

11
lib/delay/package.json Normal file
View File

@ -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"
}