From 8e7bd45cbeae254eb73ebcbd3ca9e3596a28f85d Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Tue, 16 Apr 2019 14:07:20 +0200 Subject: [PATCH] Add files via upload --- uws.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/uws.js b/uws.js index c0a2caeb..2ce00ea9 100644 --- a/uws.js +++ b/uws.js @@ -17,20 +17,15 @@ module.exports = (() => { try { - const uWS = require(`./uws_${process.platform}_${process.versions.modules}.node`); - /* We are not compatible with Node.js nextTick and/or domains */ + const uWS = require('./uws_' + process.platform + '_' + process.arch + '_' + process.versions.modules + '.node'); process.nextTick = (f, ...args) => { Promise.resolve().then(() => { f(...args); }); }; - /* You are not allowed to use the lib past here */ - process.on('exit', () => { - uWS.free(); - }); - + process.on('exit', uWS.free); return uWS; } catch (e) { - throw new Error('This version of µWS is not compatible with your Node.js build.\n\n' + e.toString()); + throw new Error('This version of µWS is not compatible with your Node.js build:\n\n' + e.toString()); } })();