From 5b32539fffc576f5d9dae2203b1f9aec6873bef6 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 17 May 2022 16:14:18 -0600 Subject: [PATCH] Use process to get platform and arch, slightly simpler, one less require, and compatible with bun --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9dfb471..590f65d 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ var fs = require('fs') var path = require('path') -var os = require('os') // Workaround to fix webpack's build warnings: 'the request of a dependency is an expression' var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line @@ -9,8 +8,8 @@ var vars = (process.config && process.config.variables) || {} var prebuildsOnly = !!process.env.PREBUILDS_ONLY var abi = process.versions.modules // TODO: support old node where this is undef var runtime = isElectron() ? 'electron' : 'node' -var arch = os.arch() -var platform = os.platform() +var arch = process.arch +var platform = process.platform var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc') var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || '' var uv = (process.versions.uv || '').split('.')[0]