kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.38k stars 510 forks source link

Support multiple platforms at once #1001

Closed johanholmerin closed 9 months ago

johanholmerin commented 9 months ago

In some situations it might be useful to have binaries for different platforms downloaded at once. For example, when using docker on Mac it's common to use npm on directly on Mac but actually run the code in the docker linux vm, which will fail due to incompatible binaries. It's possible to download for binaries for another platform by running for example npm run install -- --update-binary --target_platform=linux --target_libc=glibc, but since bcrypt uses the same file path regardless of platform/architecture this will replace the existing binary. I propose changing module_path or module_name to include platform, arch, and libc, like the package_name currently does. I can submit a PR for this if you're interested.

Related issues:

recrsn commented 9 months ago

If its achievable, sure, go ahead.

johanholmerin commented 9 months ago

Great, I've submitted a PR