Packages

cacache

21.0.2 · 11 Nov 2026ISC44M / weekRepositoryHomepagenpmAtom feed

Your version

7.0.0

major3 Apr 2017Where it was published

7.1.0 is the newest release of 7.x.

In short

9 breaking1 new1 internal

  • Breaking

    integrity: The entire API has been overhauled to use SRI hashes instead of digest/hashAlgorithm pairs. SRI hashes follow the Subresource Integrity standard and support strings and objects compatible with ssri.

  • Breaking

    This change bumps the index version, which will invalidate all previous index entries. Content entries will remain intact, and existing caches will automatically reuse any content from before this breaking change.

  • Breaking

    cacache.get.info(), cacache.ls(), and cacache.ls.stream() will now return objects that looks like this:

  • Breaking

    opts.digest and opts.hashAlgorithm are obsolete for any API calls that used them.

  • Breaking

    Anywhere opts.digest was accepted, opts.integrity is now an option. Any valid SRI hash is accepted here -- multiple hash entries will be resolved according to the standard: first, the "strongest" hash algorithm will be picked, and then each of the entries for that algorithm will be matched against the content. Content will be validated if any of the entries match (so, a single integrity string can be used for multiple "versions" of the same document/data).

  • Breaking

    put.byDigest(), put.stream.byDigest, get.byDigest() and get.stream.byDigest() now expect an SRI instead of a digest + opts.hashAlgorithm pairing.

  • Breaking

    get.hasContent() now expects an integrity hash instead of a digest. If content exists, it will return the specific single integrity hash that was found in the cache.

  • Breaking

    verify() has learned to handle integrity-based caches, and forgotten how to handle old-style cache indices due to the format change.

Release note

Features

  • integrity: subresource integrity support

Breaking changes

  • Breaking

    integrity: The entire API has been overhauled to use SRI hashes instead of digest/hashAlgorithm pairs. SRI hashes follow the Subresource Integrity standard and support strings and objects compatible with ssri.

  • Breaking

    This change bumps the index version, which will invalidate all previous index entries. Content entries will remain intact, and existing caches will automatically reuse any content from before this breaking change.

  • Breaking

    cacache.get.info(), cacache.ls(), and cacache.ls.stream() will now return objects that looks like this:

{
  key: String,
  integrity: '<algorithm>-<base64hash>',
  path: ContentPath,
  time: Date<ms>,
  metadata: Any
}
  • Breaking

    opts.digest and opts.hashAlgorithm are obsolete for any API calls that used them.

  • Breaking

    Anywhere opts.digest was accepted, opts.integrity is now an option. Any valid SRI hash is accepted here -- multiple hash entries will be resolved according to the standard: first, the "strongest" hash algorithm will be picked, and then each of the entries for that algorithm will be matched against the content. Content will be validated if any of the entries match (so, a single integrity string can be used for multiple "versions" of the same document/data).

  • Breaking

    put.byDigest(), put.stream.byDigest, get.byDigest() and get.stream.byDigest() now expect an SRI instead of a digest + opts.hashAlgorithm pairing.

  • Breaking

    get.hasContent() now expects an integrity hash instead of a digest. If content exists, it will return the specific single integrity hash that was found in the cache.

  • Breaking

    verify() has learned to handle integrity-based caches, and forgotten how to handle old-style cache indices due to the format change.

  • Breaking

    cacache.rm.content() now expects an integrity hash instead of a hex digest.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.