Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 11, 2024 via pnpm

cacache 18.0.0

Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.
Package summary
Share
6
issues
2
high severity
license
2
2
moderate severity
meta
2
2
low severity
license
2
3
licenses
26
ISC
21
MIT
2
BlueOak-1.0.0
Package created
18 Nov 2016
Version published
14 Aug 2023
Maintainers
5
Total deps
49
Direct deps
12
License
ISC

Issues

6

2 high severity issues

high
Recommendation: Read and validate the license terms
via: glob@10.3.12
Recommendation: Read and validate the license terms
via: glob@10.3.12
Collapse
Expand

2 moderate severity issues

moderate
via: minipass-collect@1.0.2
via: minipass-pipeline@1.2.4
Collapse
Expand

2 low severity issues

low
Recommendation: Read and validate the license terms
via: glob@10.3.12
Recommendation: Read and validate the license terms
via: glob@10.3.12
Collapse
Expand

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
26 Packages, Including:
@isaacs/cliui@8.0.2
@npmcli/fs@3.1.0
cacache@18.0.0
chownr@2.0.0
foreground-child@3.1.1
fs-minipass@2.1.0
fs-minipass@3.0.3
glob@10.3.12
isexe@2.0.0
lru-cache@10.2.0
lru-cache@6.0.0
minimatch@9.0.4
minipass-collect@1.0.2
minipass-flush@1.0.5
minipass-pipeline@1.2.4
minipass@3.3.6
minipass@5.0.0
minipass@7.0.4
semver@7.6.0
signal-exit@4.1.0
ssri@10.0.5
tar@6.2.1
unique-filename@3.0.0
unique-slug@4.0.0
which@2.0.2
yallist@4.0.0

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
21 Packages, Including:
@pkgjs/parseargs@0.11.0
aggregate-error@3.1.0
ansi-regex@6.0.1
ansi-styles@6.2.1
balanced-match@1.0.2
brace-expansion@2.0.1
clean-stack@2.2.0
cross-spawn@7.0.3
eastasianwidth@0.2.0
emoji-regex@9.2.2
imurmurhash@0.1.4
indent-string@4.0.0
minizlib@2.1.2
mkdirp@1.0.4
p-map@4.0.0
path-key@3.1.1
shebang-command@2.0.0
shebang-regex@3.0.0
string-width@5.1.2
strip-ansi@7.1.0
wrap-ansi@8.1.0

Blue Oak Model License 1.0.0

Uncategorized
Not OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
Cannot
Must
2 Packages, Including:
jackspeak@2.3.6
path-scurry@1.10.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

12
All Dependencies CSV
β“˜ This is a list of cacache 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@npmcli/fs3.1.08.46 kBISC
prod
fs-minipass3.0.34.41 kBISC
prod
glob10.3.12449.61 kBISC
prod
2
2
lru-cache10.2.097.45 kBISC
prod
minipass-collect1.0.22.01 kBISC
prod
1
minipass-flush1.0.51.93 kBISC
prod
minipass-pipeline1.2.42.93 kBISC
prod
1
minipass7.0.460.34 kBISC
prod
p-map4.0.03.36 kBMIT
prod
ssri10.0.511.21 kBISC
prod
tar6.2.1162.71 kBISC
prod
unique-filename3.0.01.76 kBISC
prod

Visualizations

Frequently Asked Questions

What does cacache do?

Cacache is a powerful JavaScript library that manages local key and content address caches. It is known for its speed, excellent concurrency handling, and fault tolerance that ensures data integrity even if cache files get corrupted or manipulated. Cacache maintains consistent read and write operations, provides automatic content deduplication, and supports multi-hash storage, enabling appropriate management of sha1, sha512, etc., in a single cache. It is designed with a streaming support feature for efficient data handling and also provides utility functions for managing cache directories along with offline verification and garbage collection for maintaining cache efficiency. Cacache was originally developed as npm's local cache but its functionality makes it easy to use as an independent caching solution.

How do you use cacache?

To use Cacache, you first need to install it using npm by running $ npm install --save cacache. After installing, you can require it in your program and use it to read or write cache data. Here are a few examples:

To write data to a cache, you can use cacache's put method as follows:

const cacache = require('cacache')
const cachePath = '/tmp/my-toy-cache'
const key = 'my-unique-key-1234'

cacache.put(cachePath, key, '10293801983029384').then(integrity => {
  console.log(`Saved content to ${cachePath}.`)
})

In this example '10293801983029384' is the content being saved in the cache, under the 'cachePath' directory with 'my-unique-key-1234' as the key.

To read data from a cache, cacache provides get and get.stream methods:

const fs = require('fs')

const destination = '/tmp/mytar.tgz'

// Read the contents out of the cache and into their destination
cacache.get.stream(
  cachePath, key
).pipe(
  fs.createWriteStream(destination)
).on('finish', () => {
  console.log('done extracting!')
})

const integrityHash = 'sha512-BaSe64/EnCoDED+HAsh=='

// The same thing, but skip the key index.
cacache.get.byDigest(cachePath, integrityHash).then(data => {
  fs.writeFile(destination, data, err => {
    console.log('tarball data fetched based on its sha512sum and written out!')
  })
})

In these examples, data corresponding to a certain key or a content integrity hash is being extracted from the cache and written to a file.

Where are the cacache docs?

The primary source of information on how to use cacache is the documentation provided in the Readme file on its GitHub page: git+https://github.com/npm/cacache.git. You can find detailed instructions on how to install and use the library, code examples, a comprehensive list of API endpoints and methods, descriptions of important features, and insights into how cacache manages the cache. The Readme also includes guidance on how to contribute to the project and its code of conduct.