diff --git a/nodejs/.no-postinstall b/nodejs/.no-postinstall new file mode 100644 index 0000000..e69de29 diff --git a/nodejs/package.json b/nodejs/package.json index 849e882..7b5ad47 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,13 +5,13 @@ "main": "dist/index.js", "files": [ "dist/**", - "install.js" + "postinstall.js" ], "scripts": { "build": "npm run clean && tsc", "build-binary": "neon build --release && mv native/index.node dist/native.node", "clean": "rm -rf dist", - "postinstall": "node install.js" + "postinstall": "node postinstall.js" }, "repository": { "type": "git", diff --git a/nodejs/install.js b/nodejs/postinstall.js similarity index 94% rename from nodejs/install.js rename to nodejs/postinstall.js index 5f13548..7c09cb3 100644 --- a/nodejs/install.js +++ b/nodejs/postinstall.js @@ -47,7 +47,7 @@ const downloadNativeBinary = async () => { } }; -if (!fs.existsSync(binaryPath)) { +if (!fs.existsSync(path.join(__dirname, '.no-postinstall')) && !fs.existsSync(binaryPath)) { downloadNativeBinary() .then( () => console.log(`Downloaded ${pkg.name}`),