From 0e618430ff40de29fd889f9a822ac11bdbccb1be Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 8 Feb 2019 14:07:35 -0500 Subject: [PATCH] Install delay, exit and exec modules. --- app/lib/delay/index.js | 9 +++++++++ app/lib/delay/package.json | 11 +++++++++++ app/lib/exec/package.json | 11 +++++++++++ app/lib/exit/index.js | 13 +++++++++++++ app/lib/exit/package.json | 11 +++++++++++ app/package-lock.json | 9 +++++++++ app/package.json | 3 +++ 7 files changed, 67 insertions(+) create mode 100644 app/lib/delay/index.js create mode 100644 app/lib/delay/package.json create mode 100644 app/lib/exec/package.json create mode 100644 app/lib/exit/index.js create mode 100644 app/lib/exit/package.json diff --git a/app/lib/delay/index.js b/app/lib/delay/index.js new file mode 100644 index 0000000..293a8ba --- /dev/null +++ b/app/lib/delay/index.js @@ -0,0 +1,9 @@ +'use strict'; + +function delay (ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); +} + +module.exports = delay; \ No newline at end of file diff --git a/app/lib/delay/package.json b/app/lib/delay/package.json new file mode 100644 index 0000000..9a1fe44 --- /dev/null +++ b/app/lib/delay/package.json @@ -0,0 +1,11 @@ +{ + "name": "delay", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} diff --git a/app/lib/exec/package.json b/app/lib/exec/package.json new file mode 100644 index 0000000..65f0c63 --- /dev/null +++ b/app/lib/exec/package.json @@ -0,0 +1,11 @@ +{ + "name": "exec", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} diff --git a/app/lib/exit/index.js b/app/lib/exit/index.js new file mode 100644 index 0000000..247b0da --- /dev/null +++ b/app/lib/exit/index.js @@ -0,0 +1,13 @@ +'use strict'; + +function exit (msg, code = 0) { + if (code === 0) { + console.log(msg); + process.exit(); + } else { + console.error(msg); + process.exit(code); + } +} + +module.exports = exit; \ No newline at end of file diff --git a/app/lib/exit/package.json b/app/lib/exit/package.json new file mode 100644 index 0000000..0ab494d --- /dev/null +++ b/app/lib/exit/package.json @@ -0,0 +1,11 @@ +{ + "name": "exit", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} diff --git a/app/package-lock.json b/app/package-lock.json index f9aeb1b..b45a748 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1458,6 +1458,9 @@ } } }, + "delay": { + "version": "file:lib/delay" + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2079,6 +2082,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "exec": { + "version": "file:lib/exec" + }, "exec-sh": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", @@ -2121,6 +2127,9 @@ "integrity": "sha1-BmDjUlouidnkRhKUQMJy7foktSk=", "dev": true }, + "exit": { + "version": "file:lib/exit" + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", diff --git a/app/package.json b/app/package.json index a842313..a760320 100644 --- a/app/package.json +++ b/app/package.json @@ -41,7 +41,10 @@ "arduino": "file:lib/arduino", "async": "^2.6.1", "capture": "file:lib/capture", + "delay": "file:lib/delay", "display": "file:lib/display", + "exec": "file:lib/exec", + "exit": "file:lib/exit", "ffmpeg": "file:lib/ffmpeg", "ffprobe": "file:lib/ffprobe", "fs-extra": "^7.0.1",