{"name":"cacache","description":"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.","dist-tags":{"latest":"18.0.3"},"versions":{"18.0.3":{"name":"cacache","version":"18.0.3","author":{"name":"GitHub Inc."},"license":"ISC","_id":"cacache@18.0.3","bugs":{"url":"https://github.com/npm/cacache/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"864e2c18414e1e141ae8763f31e46c2cb96d1b21","tarball":"http://localhost:4260/cacache/cacache-18.0.3.tgz","fileCount":17,"integrity":"sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==","signatures":[{"sig":"MEUCIQCC/lkDf8YH7ovTQqLbvK15fnzGfIJD1adj7kQqKK+peAIgWnG8F6vXojVvrsufossNxTJRwkt3kB21imzmvzAlRxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"http://localhost:4260/attestations/cacache@18.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":63516},"main":"lib/index.js","engines":{"node":"^16.14.0 || >=18.0.0"},"gitHead":"f9ebcea7e36403d37cd46da1567f40302b950ea7","scripts":{"lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","coverage":"tap","postlint":"template-oss-check","postsnap":"npm run lintfix --","posttest":"npm run lint","npmclilint":"npmcli-lint","test-docker":"docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test","template-oss-apply":"template-oss-apply --force"},"repository":{"url":"git+https://github.com/npm/cacache.git","type":"git"},"_npmVersion":"10.7.0","description":"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.","directories":{},"templateOSS":{"publish":"true","version":"4.22.0","windowsCI":false,"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.1.0","dependencies":{"tar":"^6.1.11","glob":"^10.2.2","ssri":"^10.0.0","p-map":"^4.0.0","minipass":"^7.0.3","lru-cache":"^10.0.1","@npmcli/fs":"^3.1.0","fs-minipass":"^3.0.0","minipass-flush":"^1.0.5","unique-filename":"^3.0.0","minipass-collect":"^2.0.1","minipass-pipeline":"^1.2.4"},"cache-version":{"index":"5","content":"2"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","@npmcli/template-oss":"4.22.0","@npmcli/eslint-config":"^4.0.0"}}},"author":{"name":"GitHub Inc."},"repository":{"url":"git+https://github.com/npm/cacache.git","type":"git"},"license":"ISC","homepage":"https://github.com/npm/cacache#readme","bugs":{"url":"https://github.com/npm/cacache/issues"},"readme":"# cacache [![npm version](https://img.shields.io/npm/v/cacache.svg)](https://npm.im/cacache) [![license](https://img.shields.io/npm/l/cacache.svg)](https://npm.im/cacache) [![Travis](https://img.shields.io/travis/npm/cacache.svg)](https://travis-ci.org/npm/cacache) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/cacache?svg=true)](https://ci.appveyor.com/project/npm/cacache) [![Coverage Status](https://coveralls.io/repos/github/npm/cacache/badge.svg?branch=latest)](https://coveralls.io/github/npm/cacache?branch=latest)\n\n[`cacache`](https://github.com/npm/cacache) is a Node.js library for managing\nlocal key and content address caches. It's really fast, really good at\nconcurrency, and it will never give you corrupted data, even if cache files\nget corrupted or manipulated.\n\nOn systems that support user and group settings on files, cacache will\nmatch the `uid` and `gid` values to the folder where the cache lives, even\nwhen running as `root`.\n\nIt was written to be used as [npm](https://npm.im)'s local cache, but can\njust as easily be used on its own.\n\n## Install\n\n`$ npm install --save cacache`\n\n## Table of Contents\n\n* [Example](#example)\n* [Features](#features)\n* [Contributing](#contributing)\n* [API](#api)\n * [Using localized APIs](#localized-api)\n * Reading\n * [`ls`](#ls)\n * [`ls.stream`](#ls-stream)\n * [`get`](#get-data)\n * [`get.stream`](#get-stream)\n * [`get.info`](#get-info)\n * [`get.hasContent`](#get-hasContent)\n * Writing\n * [`put`](#put-data)\n * [`put.stream`](#put-stream)\n * [`rm.all`](#rm-all)\n * [`rm.entry`](#rm-entry)\n * [`rm.content`](#rm-content)\n * [`index.compact`](#index-compact)\n * [`index.insert`](#index-insert)\n * Utilities\n * [`clearMemoized`](#clear-memoized)\n * [`tmp.mkdir`](#tmp-mkdir)\n * [`tmp.withTmp`](#with-tmp)\n * Integrity\n * [Subresource Integrity](#integrity)\n * [`verify`](#verify)\n * [`verify.lastRun`](#verify-last-run)\n\n### Example\n\n```javascript\nconst cacache = require('cacache')\nconst fs = require('fs')\n\nconst cachePath = '/tmp/my-toy-cache'\nconst key = 'my-unique-key-1234'\n\n// Cache it! Use `cachePath` as the root of the content cache\ncacache.put(cachePath, key, '10293801983029384').then(integrity => {\n console.log(`Saved content to ${cachePath}.`)\n})\n\nconst destination = '/tmp/mytar.tgz'\n\n// Copy the contents out of the cache and into their destination!\n// But this time, use stream instead!\ncacache.get.stream(\n cachePath, key\n).pipe(\n fs.createWriteStream(destination)\n).on('finish', () => {\n console.log('done extracting!')\n})\n\n// The same thing, but skip the key index.\ncacache.get.byDigest(cachePath, integrityHash).then(data => {\n fs.writeFile(destination, data, err => {\n console.log('tarball data fetched based on its sha512sum and written out!')\n })\n})\n```\n\n### Features\n\n* Extraction by key or by content address (shasum, etc)\n* [Subresource Integrity](#integrity) web standard support\n* Multi-hash support - safely host sha1, sha512, etc, in a single cache\n* Automatic content deduplication\n* Fault tolerance (immune to corruption, partial writes, process races, etc)\n* Consistency guarantees on read and write (full data verification)\n* Lockless, high-concurrency cache access\n* Streaming support\n* Promise support\n* Fast -- sub-millisecond reads and writes including verification\n* Arbitrary metadata storage\n* Garbage collection and additional offline verification\n* Thorough test coverage\n* There's probably a bloom filter in there somewhere. Those are cool, right? π€\n\n### Contributing\n\nThe cacache team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.\n\nAll participants and maintainers in this project are expected to follow [Code of Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other.\n\nPlease refer to the [Changelog](CHANGELOG.md) for project history details, too.\n\nHappy hacking!\n\n### API\n\n#### `> cacache.ls(cache) -> Promise