From f99290d6cedf4110e50d38002e91c71cb4a8458d Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 11 Oct 2019 17:54:29 -0400 Subject: [PATCH] Install delay module and compile from Typescript source. --- lib/delay/index.js | 15 +++++++++++++++ lib/delay/index.js.map | 1 + lib/delay/package.json | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 lib/delay/index.js create mode 100644 lib/delay/index.js.map create mode 100644 lib/delay/package.json diff --git a/lib/delay/index.js b/lib/delay/index.js new file mode 100644 index 0000000..4a0d243 --- /dev/null +++ b/lib/delay/index.js @@ -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 \ No newline at end of file diff --git a/lib/delay/index.js.map b/lib/delay/index.js.map new file mode 100644 index 0000000..38ed5e5 --- /dev/null +++ b/lib/delay/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"} \ No newline at end of file diff --git a/lib/delay/package.json b/lib/delay/package.json new file mode 100644 index 0000000..fb7fe69 --- /dev/null +++ b/lib/delay/package.json @@ -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" +}