Skip to content

v2.0.0

Choose a tag to compare

@pwlmc pwlmc released this 29 Nov 16:32
· 6 commits to master since this release

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 is dist/index.mjs and the TypeScript declarations are dist/index.d.mts.
  • Replace the default hash() API with the named hashFile() export. The public API is now hashFile, hashRaw, hexToBinary, and binaryToHex.
  • hashFile() now takes an options object: hashFile(path, { bits, format }) replaces hashFile(path, bits, format). format is typed as "hex" | "binary" and bits must be a positive multiple of 4.
  • The bits and format fields default only when omitted or undefined. Previously falsy values fell back to the defaults (bits: null or 0 meant 8, format: null or "" meant "hex"); they are now rejected.

Changelog: https://github.com/pwlmc/imghash/blob/master/packages/imghash/CHANGELOG.md#v200-2026-11-28