From 1b992ac55d9e7ef0406d7783cb2f1a7c35828c1a Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Tue, 15 Oct 2024 14:38:10 +0200 Subject: [PATCH] still run on non-node envs (#203) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e7dcfbd..2a4a305 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ const MAX_WRITE = 16 * 1024 const kContentModeBuffer = 'buffer' const kContentModeUtf8 = 'utf8' -const [major, minor] = process.versions.node.split('.').map(Number) +const [major, minor] = (process.versions.node || '0.0').split('.').map(Number) const kCopyBuffer = major >= 22 && minor >= 7 function openFile (file, sonic) {