node-argon2 is a Node.js library providing native bindings to the reference Argon2 hashing algorithm, which is a key derivation function designed to be memory-hard and suitable for password hashing. The library is actively maintained with frequent minor and patch releases, currently stable at version 0.44.0. It aims to simplify the use of Argon2 in Node.js applications by offering prebuilt binaries for common platforms (since v0.26.0, expanded significantly in v0.40.0), reducing the need for local compilation. Key differentiators include robust TypeScript support, flexibility in configuring Argon2 parameters (e.g., time cost, memory cost, parallelism), and the ability to choose between Argon2i, Argon2d, or Argon2id variants, making it a secure choice for password storage. It requires Node.js >= 16.17.0, with Node 18 or 20 being recommended.
npm install argon2Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to hash a password using default settings, verify a password against a hash, and hash with custom Argon2 parameters.
Upgrade your Node.js runtime to version 18 or 20 (preferably) to ensure compatibility and receive security updates.
Update to `argon2@0.31.0` or newer immediately to mitigate the security risk associated with the `node-pre-gyp` dependency.
Install `node-gyp` globally (`npm install -g node-gyp`) and ensure you have a suitable C++ toolchain. For macOS, use `brew install gcc`. For manual compilation, you might need to specify `CXX=g++-12 npm install argon2`.
Upgrade to `argon2@0.40.0` or newer to leverage prebuilt binaries, which significantly reduces installation complexity and build errors for most users.
Update to `argon2@0.41.1` or newer to resolve type declaration inconsistencies for byte-related inputs.
Ensure your Node.js version meets the package requirements (>=16.17.0, preferably 18/20). If using a non-standard environment or an older `argon2` version, try manually rebuilding: `npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2`.
Upgrade to `argon2@0.43.1` or newer. This version specifically addresses compatibility issues with TypeScript 5.7's `Buffer` type changes.
Upgrade to `argon2@0.41.0` or newer. This version disables LTO to prevent such symbol-related compilation errors.
Upgrade to `argon2@0.41.1` or newer to get corrected TypeScript type declarations for inputs like passwords and salts.
No dependency data recorded yet.