diff --git a/dist/early.child.js b/dist/early.child.js index 5f1b304..e031fde 100644 --- a/dist/early.child.js +++ b/dist/early.child.js @@ -35,13 +35,12 @@ let start = function (moduleNameArg = "", loaderLengthArg = "10") { logEarly(); }; start(process.env.moduleNameArg, process.env.loaderLengthArg); -process.on('SIGHUP', () => { +process.on('SIGINT', () => { logEarlyAbort = true; rl.write(null, { ctrl: true, name: 'u' }); rl.write(`loaded ${chalk.green(moduleName)}`); rl.close(); rl.on("close", () => { - process.exit(0); }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWFybHkuY2hpbGQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9lYXJseS5jaGlsZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLE1BQU8sS0FBSyxXQUFXLE9BQU8sQ0FBQyxDQUFDO0FBQ2hDLE1BQU8sUUFBUSxXQUFXLFVBQVUsQ0FBQyxDQUFDO0FBQ3RDLElBQUksRUFBRSxHQUFHLFFBQVEsQ0FBQyxlQUFlLENBQUM7SUFDOUIsS0FBSyxFQUFFLE9BQU8sQ0FBQyxLQUFLO0lBQ3BCLE1BQU0sRUFBRSxPQUFPLENBQUMsTUFBTTtDQUN6QixDQUFDLENBQUM7QUFFSCxJQUFJLFVBQWtCLENBQUM7QUFDdkIsSUFBSSxZQUFvQixDQUFDO0FBQ3pCLElBQUksWUFBWSxHQUFXLENBQUMsQ0FBQztBQUU3QixJQUFJLFNBQVMsR0FBRztJQUNaLElBQUksWUFBWSxHQUFXLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQyxZQUFZLEdBQUcsWUFBWSxDQUFDLGNBQWMsVUFBVSxFQUFFLENBQUM7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RUFBRSxDQUFDO0FBQ2YsQ0FBQyxDQUFDO0FBRUYsS0FBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsZUFBZSxDQUFDLENBQUM7QUFFOUQsT0FBTyxDQUFDLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDakIsYUFBYSxHQUFHLElBQUksQ0FBQztJQUNyQixFQUFFLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLEdBQUcsRUFBRSxDQUFDLENBQUM7SUFDMUMsRUFBRSxDQUFDLEtBQUssQ0FBQyxVQUFVLEtBQUssQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQzlDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUNYLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFDO0lBRWQsQ0FBQyxDQUFDLENBQUE7QUFDTixDQUFDLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 7c5b1f3..37471c7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34,36 +34,20 @@ exports.start = function (moduleNameArg = "", loaderLengthArg = "10") { }; exports.stop = function () { let done = q.defer(); + let endTime = process.hrtime(startTime); + let executionTime = (endTime[0] * 1e9 + endTime[1]) / 1000000000; if (doAnimation) { - earlyChild.kill("SIGHUP"); + earlyChild.kill("SIGINT"); earlyChild.on("close", function () { - let endTime = process.hrtime(startTime); - let executionTime = function () { - try { - return (endTime[0] * 1e9 + endTime[1]); - } - catch (err) { - return undefined; - } - }() / 1000000000; console.log(` in ${executionTime} seconds!`); done.resolve(); }); } else { - let endTime = process.hrtime(startTime); - let executionTime = function () { - try { - return (endTime[0] * 1e9 + endTime[1]); - } - catch (err) { - return undefined; - } - }() / 1000000000; console.log(` in ${executionTime} seconds!`); console.log(`... finished loading moduleName in ${executionTime}`); done.resolve(); } return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBQ3ZCLE1BQU8sSUFBSSxXQUFXLE1BQU0sQ0FBQyxDQUFDO0FBQzlCLE1BQU8sS0FBSyxXQUFXLE9BQU8sQ0FBQyxDQUFDO0FBQ2hDLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUVyQixNQUFPLFlBQVksV0FBVyxlQUFlLENBQUMsQ0FBQztBQUMvQyxJQUFJLFVBQVUsQ0FBQztBQUVmLElBQUksV0FBVyxHQUFZLElBQUksQ0FBQztBQUNoQyxJQUFJLE1BQU0sR0FBWSxLQUFLLENBQUM7QUFDNUIsSUFBSSxVQUFVLEdBQVcsdUJBQXVCLENBQUM7QUFDakQsSUFBSSxTQUFTLENBQUM7QUFFZCxFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7SUFDckQsV0FBVyxHQUFHLEtBQUssQ0FBQztBQUN4QixDQUFDO0FBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUMxQyxNQUFNLEdBQUcsSUFBSSxDQUFDO0FBQ2xCLENBQUM7QUFFRCxVQUFVO0FBQ0MsYUFBSyxH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yxVQUFVLENBQUM7SUFDakUsRUFBRSxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztRQUNkLFVBQVUsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDMUIsVUFBVSxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUU7WUFDbkIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLGFBQWEsV0FBVyxDQUFDLENBQUM7WUFDN0MsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ25CLENBQUMsQ0FBQyxDQUFBO0lBQ04sQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ0osT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLGFBQWEsV0FBVyxDQUFDLENBQUM7UUFDN0MsT0FBTyxDQUFDLEdBQUcsQ0FBQyxzQ0FBc0MsYUFBYSxFQUFFLENBQUMsQ0FBQztRQUNuRSxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDbkIsQ0FBQztJQUNELE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/ts/early.child.ts b/ts/early.child.ts index 52c9920..46bd12d 100644 --- a/ts/early.child.ts +++ b/ts/early.child.ts @@ -39,12 +39,12 @@ let start = function (moduleNameArg: string = "", loaderLengthArg: string = "10" start(process.env.moduleNameArg, process.env.loaderLengthArg); -process.on('SIGHUP', () => { +process.on('SIGINT', () => { logEarlyAbort = true; rl.write(null, { ctrl: true, name: 'u' }); rl.write(`loaded ${chalk.green(moduleName)}`); rl.close(); rl.on("close",() => { - process.exit(0); + }) }); \ No newline at end of file diff --git a/ts/index.ts b/ts/index.ts index 314fa87..4bc5cd5 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -38,31 +38,15 @@ export let start = function (moduleNameArg: string = "", loaderLengthArg: string export let stop = function () { let done = q.defer(); + let endTime = process.hrtime(startTime); + let executionTime = (endTime[0] * 1e9 + endTime[1]) / 1000000000; if (doAnimation) { - earlyChild.kill("SIGHUP"); + earlyChild.kill("SIGINT"); earlyChild.on("close", function () { - let endTime = process.hrtime(startTime); - let executionTime = function () { - try { - return (endTime[0] * 1e9 + endTime[1]); - } - catch (err) { - return undefined; - } - } () / 1000000000; console.log(` in ${executionTime} seconds!`); done.resolve(); }) } else { - let endTime = process.hrtime(startTime); - let executionTime = function () { - try { - return (endTime[0] * 1e9 + endTime[1]); - } - catch (err) { - return undefined; - } - } () / 1000000000; console.log(` in ${executionTime} seconds!`); console.log(`... finished loading moduleName in ${executionTime}`); done.resolve();