Repository navigation
v2.0.0
What's Changed
Breaking changes
- Require Node.js 22 or newer.
- Convert the package to ESM-only. CommonJS
require()is no longer supported; the published runtime entry isdist/index.mjsand the TypeScript declarations aredist/index.d.mts. - Replace the default
hash()API with the namedhashFile()export. The public API is nowhashFile,hashRaw,hexToBinary, andbinaryToHex. hashFile()now takes an options object:hashFile(path, { bits, format })replaceshashFile(path, bits, format).formatis typed as"hex" | "binary"andbitsmust be a positive multiple of 4.- The
bitsandformatfields default only when omitted orundefined. Previously falsy values fell back to the defaults (bits: nullor0meant8,format: nullor""meant"hex"); they are now rejected.
Changelog: https://github.com/pwlmc/imghash/blob/master/packages/imghash/CHANGELOG.md#v200-2026-11-28