"
labels: [ Bug, Needs Triage ]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- npm:
- Node:
- OS:
- platform:
validations:
required: false
npm-cacache-35d6f44/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000145 15156554446 0021744 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
blank_issues_enabled: true
npm-cacache-35d6f44/.github/actions/ 0000775 0000000 0000000 00000000000 15156554446 0017231 5 ustar 00root root 0000000 0000000 npm-cacache-35d6f44/.github/actions/create-check/ 0000775 0000000 0000000 00000000000 15156554446 0021547 5 ustar 00root root 0000000 0000000 npm-cacache-35d6f44/.github/actions/create-check/action.yml 0000664 0000000 0000000 00000002720 15156554446 0023550 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: 'Create Check'
inputs:
name:
required: true
token:
required: true
sha:
required: true
check-name:
default: ''
outputs:
check-id:
value: ${{ steps.create-check.outputs.check_id }}
runs:
using: "composite"
steps:
- name: Get Workflow Job
uses: actions/github-script@v7
id: workflow
env:
JOB_NAME: "${{ inputs.name }}"
SHA: "${{ inputs.sha }}"
with:
result-encoding: string
script: |
const { repo: { owner, repo}, runId, serverUrl } = context
const { JOB_NAME, SHA } = process.env
const job = await github.rest.actions.listJobsForWorkflowRun({
owner,
repo,
run_id: runId,
per_page: 100
}).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME)))
return [
`This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`,
'Run logs:',
job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`,
].join(' ')
- name: Create Check
uses: LouisBrunner/checks-action@v1.6.0
id: create-check
with:
token: ${{ inputs.token }}
sha: ${{ inputs.sha }}
status: in_progress
name: ${{ inputs.check-name || inputs.name }}
output: |
{"summary":"${{ steps.workflow.outputs.result }}"}
npm-cacache-35d6f44/.github/actions/install-latest-npm/ 0000775 0000000 0000000 00000000000 15156554446 0022761 5 ustar 00root root 0000000 0000000 npm-cacache-35d6f44/.github/actions/install-latest-npm/action.yml 0000664 0000000 0000000 00000003406 15156554446 0024764 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: 'Install Latest npm'
description: 'Install the latest version of npm compatible with the Node version'
inputs:
node:
description: 'Current Node version'
required: true
runs:
using: "composite"
steps:
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
- name: Update Windows npm
if: |
runner.os == 'Windows' && (
startsWith(inputs.node, 'v10.') ||
startsWith(inputs.node, 'v12.') ||
startsWith(inputs.node, 'v14.')
)
shell: cmd
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ inputs.node }}
working-directory: ${{ runner.temp }}
run: |
MATCH=""
SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
echo "node@$NODE_VERSION"
for SPEC in ${SPECS[@]}; do
ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
MATCH=$SPEC
echo "Found compatible version: npm@$MATCH"
break
fi
done
if [ -z $MATCH ]; then
echo "Could not find a compatible version of npm for node@$NODE_VERSION"
exit 1
fi
npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
- name: npm Version
shell: bash
run: npm -v
npm-cacache-35d6f44/.github/dependabot.yml 0000664 0000000 0000000 00000000656 15156554446 0020430 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
open-pull-requests-limit: 10
npm-cacache-35d6f44/.github/matchers/ 0000775 0000000 0000000 00000000000 15156554446 0017377 5 ustar 00root root 0000000 0000000 npm-cacache-35d6f44/.github/matchers/tap.json 0000664 0000000 0000000 00000001204 15156554446 0021053 0 ustar 00root root 0000000 0000000 {
"//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.",
"problemMatcher": [
{
"owner": "tap",
"pattern": [
{
"regexp": "^\\s*not ok \\d+ - (.*)",
"message": 1
},
{
"regexp": "^\\s*---"
},
{
"regexp": "^\\s*at:"
},
{
"regexp": "^\\s*line:\\s*(\\d+)",
"line": 1
},
{
"regexp": "^\\s*column:\\s*(\\d+)",
"column": 1
},
{
"regexp": "^\\s*file:\\s*(.*)",
"file": 1
}
]
}
]
}
npm-cacache-35d6f44/.github/settings.yml 0000664 0000000 0000000 00000001377 15156554446 0020164 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
repository:
allow_merge_commit: false
allow_rebase_merge: true
allow_squash_merge: true
squash_merge_commit_title: PR_TITLE
squash_merge_commit_message: PR_BODY
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
branches:
- name: main
protection:
required_status_checks: null
enforce_admins: true
block_creations: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
require_last_push_approval: true
dismiss_stale_reviews: true
restrictions:
apps: []
users: []
teams: [ "cli-team" ]
npm-cacache-35d6f44/.github/workflows/ 0000775 0000000 0000000 00000000000 15156554446 0017626 5 ustar 00root root 0000000 0000000 npm-cacache-35d6f44/.github/workflows/audit.yml 0000664 0000000 0000000 00000002275 15156554446 0021465 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Audit
on:
workflow_dispatch:
schedule:
# "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
npm-cacache-35d6f44/.github/workflows/ci-release.yml 0000664 0000000 0000000 00000010567 15156554446 0022373 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI - Release
on:
workflow_dispatch:
inputs:
ref:
required: true
type: string
default: main
workflow_call:
inputs:
ref:
required: true
type: string
check-sha:
required: true
type: string
permissions:
contents: read
checks: write
jobs:
lint-all:
name: Lint All
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Create Check
id: create-check
if: ${{ inputs.check-sha }}
uses: ./.github/actions/create-check
with:
name: "Lint All"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ inputs.check-sha }}
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
test-all:
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-13
shell: bash
node-version:
- 20.17.0
- 20.x
- 22.9.0
- 22.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Create Check
id: create-check
if: ${{ inputs.check-sha }}
uses: ./.github/actions/create-check
with:
name: "Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ inputs.check-sha }}
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
npm-cacache-35d6f44/.github/workflows/ci.yml 0000664 0000000 0000000 00000006021 15156554446 0020743 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"
permissions:
contents: read
jobs:
lint:
name: Lint
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
test:
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-13
shell: bash
node-version:
- 20.17.0
- 20.x
- 22.9.0
- 22.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts
npm-cacache-35d6f44/.github/workflows/codeql-analysis.yml 0000664 0000000 0000000 00000001606 15156554446 0023444 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
- cron: "0 10 * * 1"
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
npm-cacache-35d6f44/.github/workflows/post-dependabot.yml 0000664 0000000 0000000 00000012004 15156554446 0023436 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Post Dependabot
on: pull_request
permissions:
contents: write
jobs:
template-oss:
name: template-oss
if: github.repository_owner == 'npm' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Fetch Dependabot Metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Dependabot can update multiple directories so we output which directory
# it is acting on so we can run the command for the correct root or workspace
- name: Get Dependabot Directory
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
dependabot_dir="${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" || "$dependabot_dir" == "/main" ]]; then
echo "workspace=-iwr" >> $GITHUB_OUTPUT
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi
- name: Apply Changes
if: steps.flags.outputs.workspace
id: apply
run: |
npm run template-oss-apply ${{ steps.flags.outputs.workspace }}
if [[ `git status --porcelain` ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
fi
# This only sets the conventional commit prefix. This workflow can't reliably determine
# what the breaking change is though. If a BREAKING CHANGE message is required then
# this PR check will fail and the commit will be amended with stafftools
if [[ "${{ steps.metadata.outputs.update-type }}" == "version-update:semver-major" ]]; then
prefix='feat!'
else
prefix='chore'
fi
echo "message=$prefix: postinstall for dependabot template-oss PR" >> $GITHUB_OUTPUT
# This step will fail if template-oss has made any workflow updates. It is impossible
# for a workflow to update other workflows. In the case it does fail, we continue
# and then try to apply only a portion of the changes in the next step
- name: Push All Changes
if: steps.apply.outputs.changes
id: push
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit -am "${{ steps.apply.outputs.message }}"
git push
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git reset HEAD~
git checkout HEAD -- .github/workflows/
git clean -fd .github/workflows/
git commit -am "${{ steps.apply.outputs.message }}"
git push
# Check if all the necessary template-oss changes were applied. Since we continued
# on errors in one of the previous steps, this check will fail if our follow up
# only applied a portion of the changes and we need to followup manually.
#
# Note that this used to run `lint` and `postlint` but that will fail this action
# if we've also shipped any linting changes separate from template-oss. We do
# linting in another action, so we want to fail this one only if there are
# template-oss changes that could not be applied.
- name: Check Changes
if: steps.apply.outputs.changes
run: |
npm exec --offline ${{ steps.flags.outputs.workspace }} -- template-oss-check
- name: Fail on Breaking Change
if: steps.apply.outputs.changes && startsWith(steps.apply.outputs.message, 'feat!')
run: |
echo "This PR has a breaking change. Run 'npx -p @npmcli/stafftools gh template-oss-fix'"
echo "for more information on how to fix this with a BREAKING CHANGE footer."
exit 1
npm-cacache-35d6f44/.github/workflows/pull-request.yml 0000664 0000000 0000000 00000002737 15156554446 0023024 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Pull Request
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
contents: read
jobs:
commitlint:
name: Lint Commits
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run Commitlint on Commits
id: commit
continue-on-error: true
run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
- name: Run Commitlint on PR Title
if: steps.commit.outcome == 'failure'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx --offline commitlint -V
npm-cacache-35d6f44/.github/workflows/release-integration.yml 0000664 0000000 0000000 00000004163 15156554446 0024316 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Release Integration
on:
workflow_dispatch:
inputs:
releases:
required: true
type: string
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
workflow_call:
inputs:
releases:
required: true
type: string
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
secrets:
PUBLISH_TOKEN:
required: true
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(inputs.releases)[0].tagName }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Set npm authToken
run: npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
RELEASES: ${{ inputs.releases }}
run: |
EXIT_CODE=0
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
npm publish --provenance --tag="$PUBLISH_TAG"
STATUS=$?
if [[ "$STATUS" -eq 1 ]]; then
EXIT_CODE=$STATUS
fi
done
exit $EXIT_CODE
npm-cacache-35d6f44/.github/workflows/release.yml 0000664 0000000 0000000 00000026106 15156554446 0021776 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
checks: write
jobs:
release:
outputs:
pr: ${{ steps.release.outputs.pr }}
pr-branch: ${{ steps.release.outputs.pr-branch }}
pr-number: ${{ steps.release.outputs.pr-number }}
pr-sha: ${{ steps.release.outputs.pr-sha }}
releases: ${{ steps.release.outputs.releases }}
comment-id: ${{ steps.create-comment.outputs.comment-id || steps.update-comment.outputs.comment-id }}
check-id: ${{ steps.create-check.outputs.check-id }}
name: Release
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Release Please
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx --offline template-oss-release-please --branch="${{ github.ref_name }}" --backport="" --defaultTag="latest"
- name: Create Release Manager Comment Text
if: steps.release.outputs.pr-number
uses: actions/github-script@v7
id: comment-text
with:
result-encoding: string
script: |
const { runId, repo: { owner, repo } } = context
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
return['## Release Manager', `Release workflow run: ${workflow.html_url}`].join('\n\n')
- name: Find Release Manager Comment
uses: peter-evans/find-comment@v2
if: steps.release.outputs.pr-number
id: found-comment
with:
issue-number: ${{ steps.release.outputs.pr-number }}
comment-author: 'github-actions[bot]'
body-includes: '## Release Manager'
- name: Create Release Manager Comment
id: create-comment
if: steps.release.outputs.pr-number && !steps.found-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ steps.release.outputs.pr-number }}
body: ${{ steps.comment-text.outputs.result }}
- name: Update Release Manager Comment
id: update-comment
if: steps.release.outputs.pr-number && steps.found-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.found-comment.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'replace'
- name: Create Check
id: create-check
uses: ./.github/actions/create-check
if: steps.release.outputs.pr-sha
with:
name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.release.outputs.pr-sha }}
update:
needs: release
outputs:
sha: ${{ steps.commit.outputs.sha }}
check-id: ${{ steps.create-check.outputs.check-id }}
name: Update - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.release.outputs.pr-branch }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Create Release Manager Checklist Text
id: comment-text
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec --offline -- template-oss-release-manager --pr="${{ needs.release.outputs.pr-number }}" --backport="" --defaultTag="latest" --publish
- name: Append Release Manager Comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ needs.release.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'append'
- name: Run Post Pull Request Actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run rp-pull-request --ignore-scripts --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit --all --amend --no-edit || true
git push --force-with-lease
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Create Check
id: create-check
uses: ./.github/actions/create-check
with:
name: "Update - Release"
check-name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.commit.outputs.sha }}
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ needs.release.outputs.check-id }}
ci:
name: CI - Release
needs: [ release, update ]
if: needs.release.outputs.pr
uses: ./.github/workflows/ci-release.yml
with:
ref: ${{ needs.release.outputs.pr-branch }}
check-sha: ${{ needs.update.outputs.sha }}
post-ci:
needs: [ release, update, ci ]
name: Post CI - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get CI Conclusion
id: conclusion
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="failure"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="cancelled"
else
result="success"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ steps.conclusion.outputs.result }}
check_id: ${{ needs.update.outputs.check-id }}
post-release:
needs: release
outputs:
comment-id: ${{ steps.create-comment.outputs.comment-id }}
name: Post Release - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Create Release PR Comment Text
id: comment-text
uses: actions/github-script@v7
env:
RELEASES: ${{ needs.release.outputs.releases }}
with:
result-encoding: string
script: |
const releases = JSON.parse(process.env.RELEASES)
const { runId, repo: { owner, repo } } = context
const issue_number = releases[0].prNumber
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
return [
'## Release Workflow\n',
...releases.map(r => `- \`${r.pkgName}@${r.version}\` ${r.url}`),
`- Workflow run: :arrows_counterclockwise: ${runUrl}`,
].join('\n')
- name: Create Release PR Comment
id: create-comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
body: ${{ steps.comment-text.outputs.result }}
release-integration:
needs: release
name: Release Integration
if: needs.release.outputs.releases
uses: ./.github/workflows/release-integration.yml
permissions:
contents: read
id-token: write
secrets:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
with:
releases: ${{ needs.release.outputs.releases }}
post-release-integration:
needs: [ release, release-integration, post-release ]
name: Post Release Integration - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get Post Release Conclusion
id: conclusion
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="heavy_multiplication_x"
else
result="white_check_mark"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- name: Find Release PR Comment
uses: peter-evans/find-comment@v2
id: found-comment
with:
issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
comment-author: 'github-actions[bot]'
body-includes: '## Release Workflow'
- name: Create Release PR Comment Text
id: comment-text
if: steps.found-comment.outputs.comment-id
uses: actions/github-script@v7
env:
RESULT: ${{ steps.conclusion.outputs.result }}
BODY: ${{ steps.found-comment.outputs.comment-body }}
with:
result-encoding: string
script: |
const { RESULT, BODY } = process.env
const body = [BODY.replace(/(Workflow run: :)[a-z_]+(:)/, `$1${RESULT}$2`)]
if (RESULT !== 'white_check_mark') {
body.push(':rotating_light::rotating_light::rotating_light:')
body.push([
'@npm/cli-team: The post-release workflow failed for this release.',
'Manual steps may need to be taken after examining the workflow output.'
].join(' '))
body.push(':rotating_light::rotating_light::rotating_light:')
}
return body.join('\n\n').trim()
- name: Update Release PR Comment
if: steps.comment-text.outputs.result
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.found-comment.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'replace'
npm-cacache-35d6f44/.gitignore 0000664 0000000 0000000 00000001050 15156554446 0016215 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
# ignore everything in the root
/*
!**/.gitignore
!/.commitlintrc.js
!/.eslint.config.js
!/.eslintrc.js
!/.eslintrc.local.*
!/.git-blame-ignore-revs
!/.github/
!/.gitignore
!/.npmrc
!/.prettierignore
!/.prettierrc.js
!/.release-please-manifest.json
!/bin/
!/CHANGELOG*
!/CODE_OF_CONDUCT.md
!/CONTRIBUTING.md
!/docs/
!/lib/
!/LICENSE*
!/map.js
!/package.json
!/README*
!/release-please-config.json
!/scripts/
!/SECURITY.md
!/tap-snapshots/
!/test/
!/tsconfig.json
tap-testdir*/
npm-cacache-35d6f44/.npmrc 0000664 0000000 0000000 00000000135 15156554446 0015350 0 ustar 00root root 0000000 0000000 ; This file is automatically added by @npmcli/template-oss. Do not edit.
package-lock=false
npm-cacache-35d6f44/.release-please-manifest.json 0000664 0000000 0000000 00000000024 15156554446 0021671 0 ustar 00root root 0000000 0000000 {
".": "20.0.4"
}
npm-cacache-35d6f44/CHANGELOG.md 0000664 0000000 0000000 00000142436 15156554446 0016054 0 ustar 00root root 0000000 0000000 # Changelog
## [20.0.4](https://github.com/npm/cacache/compare/v20.0.3...v20.0.4) (2026-03-18)
### Dependencies
* [`dd3ff61`](https://github.com/npm/cacache/commit/dd3ff617dea9f5d1610b44ffd2d196e4839a1251) [#328](https://github.com/npm/cacache/pull/328) remove unique-filename
### Chores
* [`1cf5e0c`](https://github.com/npm/cacache/commit/1cf5e0c52f67c73dc324e509b65f868bc4bb0780) [#326](https://github.com/npm/cacache/pull/326) bump @npmcli/template-oss from 4.28.1 to 4.29.0 (#326) (@dependabot[bot], @npm-cli-bot)
## [20.0.3](https://github.com/npm/cacache/compare/v20.0.2...v20.0.3) (2025-11-19)
### Dependencies
* [`f3a2cdd`](https://github.com/npm/cacache/commit/f3a2cdd8886097190f12d5770009fc27d3dd9496) [#322](https://github.com/npm/cacache/pull/322) bump glob from 11.1.0 to 13.0.0 (#322) (@dependabot[bot])
* [`6f96e0f`](https://github.com/npm/cacache/commit/6f96e0f5233b66b681035f5bc096d81669ce1d1b) [#319](https://github.com/npm/cacache/pull/319) bump @npmcli/fs from 4.0.0 to 5.0.0 (#319) (@dependabot[bot])
* [`49565c9`](https://github.com/npm/cacache/commit/49565c946702ecd2d6c3766c7f3ffa8df6a5723f) [#320](https://github.com/npm/cacache/pull/320) bump unique-filename from 4.0.0 to 5.0.0 (#320) (@dependabot[bot])
### Chores
* [`f813148`](https://github.com/npm/cacache/commit/f81314803953a1f5e203f06fde1b434a61dd17e4) [#321](https://github.com/npm/cacache/pull/321) bump @npmcli/eslint-config from 5.1.0 to 6.0.1 (#321) (@dependabot[bot])
* [`57fc04f`](https://github.com/npm/cacache/commit/57fc04fc00836ba5aaa32a035574f8a575c9b982) [#323](https://github.com/npm/cacache/pull/323) bump @npmcli/template-oss from 4.25.0 to 4.28.0 (#323) (@dependabot[bot], @npm-cli-bot)
## [20.0.2](https://github.com/npm/cacache/compare/v20.0.1...v20.0.2) (2025-11-17)
### Dependencies
* [`79d843c`](https://github.com/npm/cacache/commit/79d843c53392d6ae3749f70fab18af38b47556f5) [#316](https://github.com/npm/cacache/pull/316) `ssri@13.0.0` (#316)
## [20.0.1](https://github.com/npm/cacache/compare/v20.0.0...v20.0.1) (2025-08-18)
### Dependencies
* [`b237808`](https://github.com/npm/cacache/commit/b2378084aa51149e6a00d16096b13135162d7c10) [#314](https://github.com/npm/cacache/pull/314) remove tar (#314)
## [20.0.0](https://github.com/npm/cacache/compare/v19.0.1...v20.0.0) (2025-07-24)
### ⚠️ BREAKING CHANGES
* `cacache` now supports node `^20.17.0 || >=22.9.0`
### Bug Fixes
* [`de558cb`](https://github.com/npm/cacache/commit/de558cb45560aa1560fff12b8e3f49784c2ef920) [#310](https://github.com/npm/cacache/pull/310) align to npm 11 node engine range (@owlstronaut)
### Dependencies
* [`7d2cfd1`](https://github.com/npm/cacache/commit/7d2cfd16f680a0787dcb045b3db12ef5748cd362) [#310](https://github.com/npm/cacache/pull/310) `@npmcli/template-oss@4.25.0`
* [`caf9538`](https://github.com/npm/cacache/commit/caf953852b0c5d3b91484c5021c712032d8c4b02) [#310](https://github.com/npm/cacache/pull/310) `lru-cache@11.1.0`
* [`bdc28cf`](https://github.com/npm/cacache/commit/bdc28cf6c7cb7287e52abfb1cbcb294dfa29a0ad) [#310](https://github.com/npm/cacache/pull/310) `glob@11.0.3`
### Chores
* [`7d005df`](https://github.com/npm/cacache/commit/7d005dfc07fff670753deb54c3ce67903b2f6859) [#310](https://github.com/npm/cacache/pull/310) template-oss apply fix (@owlstronaut)
* [`49e75b8`](https://github.com/npm/cacache/commit/49e75b8809f3de5fd96865c398d84a4375f2653d) [#304](https://github.com/npm/cacache/pull/304) bump @npmcli/template-oss from 4.23.3 to 4.23.4 (#304) (@dependabot[bot], @npm-cli-bot)
## [19.0.1](https://github.com/npm/cacache/compare/v19.0.0...v19.0.1) (2024-09-26)
### Dependencies
* [`e56c7fc`](https://github.com/npm/cacache/commit/e56c7fc776c94937763ffe2f8ed9f92cac4f50a6) [#302](https://github.com/npm/cacache/pull/302) update p-map from ^4.0.0 to ^7.0.2 (#302)
## [19.0.0](https://github.com/npm/cacache/compare/v18.0.4...v19.0.0) (2024-09-26)
### ⚠️ BREAKING CHANGES
* `cacache` now supports node `^18.17.0 || >=20.5.0`
### Bug Fixes
* [`cc9eee3`](https://github.com/npm/cacache/commit/cc9eee342bb6be30613d8ca2090d404221ee6b59) [#300](https://github.com/npm/cacache/pull/300) align to npm 10 node engine range (@reggi)
### Dependencies
* [`beaab7c`](https://github.com/npm/cacache/commit/beaab7c85bf487b90f9248ed76bfbccbc93e75b5) [#291](https://github.com/npm/cacache/pull/291) bump tar from 6.2.1 to 7.4.3 (#291)
* [`81b6e34`](https://github.com/npm/cacache/commit/81b6e34e2a6ea2055d430e2e818d7648fcf338a8) [#300](https://github.com/npm/cacache/pull/300) `unique-filename@4.0.0`
* [`dcab1af`](https://github.com/npm/cacache/commit/dcab1af53f5ec8bda75f1084572df19e8611a87d) [#300](https://github.com/npm/cacache/pull/300) `ssri@12.0.0`
* [`ba3a3b8`](https://github.com/npm/cacache/commit/ba3a3b8d9f1395103a7fb090d3bd62b1be88f5ba) [#300](https://github.com/npm/cacache/pull/300) `@npmcli/fs@4.0.0`
### Chores
* [`73ce729`](https://github.com/npm/cacache/commit/73ce729c05453b3d8264daf06598f9de5acfe5a7) [#300](https://github.com/npm/cacache/pull/300) run template-oss-apply (@reggi)
* [`f663562`](https://github.com/npm/cacache/commit/f663562addcb9bf56eda9764c05b5de42d294672) [#294](https://github.com/npm/cacache/pull/294) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
* [`74ac800`](https://github.com/npm/cacache/commit/74ac800263888fcc621fd03b220b5fbd2a7c7ce9) [#295](https://github.com/npm/cacache/pull/295) postinstall for dependabot template-oss PR (@hashtagchris)
* [`ae95894`](https://github.com/npm/cacache/commit/ae9589421cc9e70381f589d63afdeabec36261ce) [#295](https://github.com/npm/cacache/pull/295) bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])
## [18.0.4](https://github.com/npm/cacache/compare/v18.0.3...v18.0.4) (2024-07-11)
### Bug Fixes
* [`5f2166a`](https://github.com/npm/cacache/commit/5f2166a37b82fc027c2ed5c5df3b42f2e3d96e2f) [#285](https://github.com/npm/cacache/pull/285) Limit concurrent open files during `lsstream` (#285) (@oikumene)
## [18.0.3](https://github.com/npm/cacache/compare/v18.0.2...v18.0.3) (2024-05-04)
### Bug Fixes
* [`326c7a3`](https://github.com/npm/cacache/commit/326c7a34829810f934ba8dd51d010ef03d619702) [#269](https://github.com/npm/cacache/pull/269) linting: no-unused-vars (@lukekarrys)
### Chores
* [`b685cb5`](https://github.com/npm/cacache/commit/b685cb51ef8de7f570f42c9053e8cbaa6ae09c6a) [#269](https://github.com/npm/cacache/pull/269) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
* [`4a66453`](https://github.com/npm/cacache/commit/4a66453c237fe4573fcb725a3435b3ccc9bf20c2) [#269](https://github.com/npm/cacache/pull/269) postinstall for dependabot template-oss PR (@lukekarrys)
* [`4359f2c`](https://github.com/npm/cacache/commit/4359f2c9189a89e200f945d9edfc1eda96fcdd17) [#264](https://github.com/npm/cacache/pull/264) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])
## [18.0.2](https://github.com/npm/cacache/compare/v18.0.1...v18.0.2) (2024-01-03)
### Bug Fixes
* [`b9f488d`](https://github.com/npm/cacache/commit/b9f488d8667e76aefb9c25d2ff51c81fd9f8539c) [#255](https://github.com/npm/cacache/pull/255) Speed up cache reads (#255) (@thecodrr)
### Chores
* [`7eab139`](https://github.com/npm/cacache/commit/7eab1395432d3a85fad394b810c9aa6929473e25) [#252](https://github.com/npm/cacache/pull/252) postinstall for dependabot template-oss PR (@lukekarrys)
* [`44bedb2`](https://github.com/npm/cacache/commit/44bedb24525fc24d1140c9b434ab23f35bbc70b8) [#252](https://github.com/npm/cacache/pull/252) bump @npmcli/template-oss from 4.21.1 to 4.21.3 (@dependabot[bot])
* [`a12bdf3`](https://github.com/npm/cacache/commit/a12bdf3a3bede99fb3024adeb770ef3f8495240b) [#248](https://github.com/npm/cacache/pull/248) postinstall for dependabot template-oss PR (@lukekarrys)
* [`62e5a94`](https://github.com/npm/cacache/commit/62e5a9499103a23a4701077008017516d2f794bf) [#248](https://github.com/npm/cacache/pull/248) bump @npmcli/template-oss from 4.19.0 to 4.21.1 (@dependabot[bot])
## [18.0.1](https://github.com/npm/cacache/compare/v18.0.0...v18.0.1) (2023-11-27)
### Bug Fixes
* [`6755c0e`](https://github.com/npm/cacache/commit/6755c0ebb310a7531e456a76eeec7dba06246e10) [#250](https://github.com/npm/cacache/pull/250) attach a catch handler to the handleContentP promise (#250) (@kalinkrustev)
### Dependencies
* [`0a5c204`](https://github.com/npm/cacache/commit/0a5c204edc5c738a914317c68cce91e7e9a06b6d) [#221](https://github.com/npm/cacache/pull/221) bump minipass-collect from 1.0.2 to 2.0.1
## [18.0.0](https://github.com/npm/cacache/compare/v17.1.4...v18.0.0) (2023-08-14)
### ⚠️ BREAKING CHANGES
* support for node 14 has been removed
### Bug Fixes
* [`bdff8ca`](https://github.com/npm/cacache/commit/bdff8cab5bb6446599fb25b9a9f408d157db81be) [#219](https://github.com/npm/cacache/pull/219) use lru-cache named export (@lukekarrys)
* [`0db9bcb`](https://github.com/npm/cacache/commit/0db9bcbb58bce80384de2c0d384a5f1311fa5428) [#219](https://github.com/npm/cacache/pull/219) drop node14 support (@lukekarrys)
### Dependencies
* [`0850b54`](https://github.com/npm/cacache/commit/0850b5437e9e3b099575f629d6a69d6ab47eefde) [#219](https://github.com/npm/cacache/pull/219) bump lru-cache from 7.18.3 to 10.0.1
## [17.1.4](https://github.com/npm/cacache/compare/v17.1.3...v17.1.4) (2023-08-14)
### Dependencies
* [`4b82a42`](https://github.com/npm/cacache/commit/4b82a428bc6177732aec71cc33e414d09d59adcb) [#217](https://github.com/npm/cacache/pull/217) bump minipass from 5.0.0 to 7.0.3
## [17.1.3](https://github.com/npm/cacache/compare/v17.1.2...v17.1.3) (2023-05-18)
### Bug Fixes
* [`a0a5e58`](https://github.com/npm/cacache/commit/a0a5e581fb0405c2e4cbc9b3b8eb745eb8143a86) [#209](https://github.com/npm/cacache/pull/209) normalize win32 paths to use on glob expressions (#209) (@supita)
## [17.1.2](https://github.com/npm/cacache/compare/v17.1.1...v17.1.2) (2023-05-16)
### Bug Fixes
* [`bd846d0`](https://github.com/npm/cacache/commit/bd846d02205d21aa199798351cb427bcae53ea4a) [#206](https://github.com/npm/cacache/pull/206) catch eexists in moveOperations promise (#206) (@wraithgar)
## [17.1.1](https://github.com/npm/cacache/compare/v17.1.0...v17.1.1) (2023-05-16)
### Bug Fixes
* [`988d77a`](https://github.com/npm/cacache/commit/988d77aa7f71917f16d9f27210544029c15c8f98) [#203](https://github.com/npm/cacache/pull/203) deduplicate move operations (#203) (@wraithgar)
## [17.1.0](https://github.com/npm/cacache/compare/v17.0.7...v17.1.0) (2023-05-02)
### Features
* [`2e83cfc`](https://github.com/npm/cacache/commit/2e83cfc4013f37359ea7f49d23bc659b76f9f356) [#200](https://github.com/npm/cacache/pull/200) write: accept multiple integrity algorithms (#200) (@wraithgar)
### Bug Fixes
* [`62b2d8d`](https://github.com/npm/cacache/commit/62b2d8d06ae0a762d74a12bac17fc50a42731ee3) [#199](https://github.com/npm/cacache/pull/199) don't clobber time when verifying cache (#199) (@wraithgar)
* [`e227c50`](https://github.com/npm/cacache/commit/e227c5006a4cd9648ab684f1ea13ce19f9508a23) [#197](https://github.com/npm/cacache/pull/197) verify: allow for entries with multiple hashes (#197) (@wraithgar)
### Documentation
* [`1b3774e`](https://github.com/npm/cacache/commit/1b3774e5c6be2608ac8d9513f9a13307015f457a) [#201](https://github.com/npm/cacache/pull/201) update readme links (#201) (@wraithgar)
## [17.0.7](https://github.com/npm/cacache/compare/v17.0.6...v17.0.7) (2023-05-01)
### Bug Fixes
* [`265e4ae`](https://github.com/npm/cacache/commit/265e4aeb9b6cbfcd07c75059508b7617b5169d73) [#195](https://github.com/npm/cacache/pull/195) Trust the filesystem to move files (@wraithgar)
### Dependencies
* [`11fc035`](https://github.com/npm/cacache/commit/11fc0353cb748abeee76ecbce11b6c18d351fb19) [#195](https://github.com/npm/cacache/pull/195) remove promise-inflight
## [17.0.6](https://github.com/npm/cacache/compare/v17.0.5...v17.0.6) (2023-04-27)
### Dependencies
* [`46b8457`](https://github.com/npm/cacache/commit/46b845730cdba25e8d2da9a58a60c47ae7648863) [#191](https://github.com/npm/cacache/pull/191) bump glob from 9.3.5 to 10.2.2 (#191)
* [`5e9e825`](https://github.com/npm/cacache/commit/5e9e8251a1e83124113cc7e9edad5ea71dd789e7) [#182](https://github.com/npm/cacache/pull/182) bump minipass from 4.2.7 to 5.0.0 (#182)
## [17.0.5](https://github.com/npm/cacache/compare/v17.0.4...v17.0.5) (2023-03-21)
### Dependencies
* [`a6dd005`](https://github.com/npm/cacache/commit/a6dd005da900de139f575caab660046e88974e0a) [#176](https://github.com/npm/cacache/pull/176) bump glob from 8.1.0 to 9.3.1 (#176)
## [17.0.4](https://github.com/npm/cacache/compare/v17.0.3...v17.0.4) (2022-12-14)
### Dependencies
* [`fe71fab`](https://github.com/npm/cacache/commit/fe71fabaacadc8a06b8142141a1d0e63fbed537c) [#159](https://github.com/npm/cacache/pull/159) bump fs-minipass from 2.1.0 to 3.0.0
## [17.0.3](https://github.com/npm/cacache/compare/v17.0.2...v17.0.3) (2022-12-07)
### Dependencies
* [`0dc98f7`](https://github.com/npm/cacache/commit/0dc98f7ca0940ea010ef3ba5257887e36083b3a2) [#156](https://github.com/npm/cacache/pull/156) bump minipass from 3.3.6 to 4.0.0
## [17.0.2](https://github.com/npm/cacache/compare/v17.0.1...v17.0.2) (2022-11-04)
### Bug Fixes
* [`4a7382f`](https://github.com/npm/cacache/commit/4a7382f5e6c72c59587d45167346c1b6e81a3cde) [#152](https://github.com/npm/cacache/pull/152) replace @npmcli/move-file with @npmcli/fs (@lukekarrys)
## [17.0.1](https://github.com/npm/cacache/compare/v17.0.0...v17.0.1) (2022-10-17)
### Dependencies
* [`d3515de`](https://github.com/npm/cacache/commit/d3515dec8ee6305d564389f5e52363637666f718) [#146](https://github.com/npm/cacache/pull/146) bump unique-filename from 2.0.1 to 3.0.0
* [`e57ebd9`](https://github.com/npm/cacache/commit/e57ebd9edcd4ac93df7ccbe1eee66a7a2c41c0a7) [#143](https://github.com/npm/cacache/pull/143) bump ssri from 9.0.1 to 10.0.0
* [`9dd537a`](https://github.com/npm/cacache/commit/9dd537a5ab53f5f84e16ff9e69ebd9f28e3f8c54) [#144](https://github.com/npm/cacache/pull/144) bump @npmcli/move-file from 2.0.1 to 3.0.0
## [17.0.0](https://github.com/npm/cacache/compare/v16.1.3...v17.0.0) (2022-10-13)
### ⚠️ BREAKING CHANGES
* this module no longer attempts to change file ownership automatically
* this package is now async only, all synchronous methods have been removed
* `cacache` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
### Features
* [`479b135`](https://github.com/npm/cacache/commit/479b1352a72ea3a6bc403545e269d3add985c6ee) [#141](https://github.com/npm/cacache/pull/141) do not alter file ownership (#141) (@nlf)
* [`f57bb4d`](https://github.com/npm/cacache/commit/f57bb4d3ec6147843fac673c6578c3d231f336df) [#140](https://github.com/npm/cacache/pull/140) remove sync methods (#140) (@nlf)
* [`cfebcde`](https://github.com/npm/cacache/commit/cfebcdea59e3fc1ff33fbe4b3fa6f05aa765326f) [#133](https://github.com/npm/cacache/pull/133) postinstall for dependabot template-oss PR (@lukekarrys)
## [16.1.3](https://github.com/npm/cacache/compare/v16.1.2...v16.1.3) (2022-08-23)
### Dependencies
* bump unique-filename from 1.1.1 to 2.0.0 ([#123](https://github.com/npm/cacache/issues/123)) ([6235554](https://github.com/npm/cacache/commit/6235554e46d19a9d9af25f87aa797fb85efc9519))
## [16.1.2](https://github.com/npm/cacache/compare/v16.1.1...v16.1.2) (2022-08-15)
### Bug Fixes
* linting ([#121](https://github.com/npm/cacache/issues/121)) ([a683cff](https://github.com/npm/cacache/commit/a683cffdfd956e1a4ac0e5ccbfa30615192e1ea0))
## [16.1.1](https://github.com/npm/cacache/compare/v16.1.0...v16.1.1) (2022-06-02)
### Bug Fixes
* **read:** change lstat to stat to correctly evaluate file size ([#114](https://github.com/npm/cacache/issues/114)) ([e3a2928](https://github.com/npm/cacache/commit/e3a2928e053e19fb6e8e73946ffe3d212e402ba7))
## [16.1.0](https://github.com/npm/cacache/compare/v16.0.7...v16.1.0) (2022-05-17)
### Features
* allow external integrity/size source ([#110](https://github.com/npm/cacache/issues/110)) ([61785e1](https://github.com/npm/cacache/commit/61785e106765f4b44041de318f6e387d93759e60))
### Bug Fixes
* move to async functions where possible ([#106](https://github.com/npm/cacache/issues/106)) ([71d4389](https://github.com/npm/cacache/commit/71d4389ff8a35330c3fedce97761094e243d4faf))
### [16.0.7](https://github.com/npm/cacache/compare/v16.0.6...v16.0.7) (2022-04-27)
### Bug Fixes
* **put:** don't flush if an error happened ([e870016](https://github.com/npm/cacache/commit/e8700167e036f392e5554af2d582caa17e4e7237))
* remove disposer ([76ab648](https://github.com/npm/cacache/commit/76ab64857b6874bc54d542ddd483c526434c0b9b))
* remove fs.copyFile checks ([90776fd](https://github.com/npm/cacache/commit/90776fd4a6c5362ea56a979b9611bdf4391e1fd8))
### [16.0.6](https://github.com/npm/cacache/compare/v16.0.5...v16.0.6) (2022-04-21)
### Bug Fixes
* normalize win32 paths before globbing ([4bdd5d5](https://github.com/npm/cacache/commit/4bdd5d5ce21147d67a46b6d2e1ec65007b31705c))
### [16.0.5](https://github.com/npm/cacache/compare/v16.0.4...v16.0.5) (2022-04-20)
### Dependencies
* bump glob from 7.2.0 to 8.0.1 ([#98](https://github.com/npm/cacache/issues/98)) ([74a11f9](https://github.com/npm/cacache/commit/74a11f9f5a1543d593217078a5357707680e2bb1))
### [16.0.4](https://github.com/npm/cacache/compare/v16.0.3...v16.0.4) (2022-04-05)
### Dependencies
* bump @npmcli/move-file from 1.1.2 to 2.0.0 ([#94](https://github.com/npm/cacache/issues/94)) ([f3d64f6](https://github.com/npm/cacache/commit/f3d64f6c238f99433df260fe52081177bdedee86))
* bump ssri from 8.0.1 to 9.0.0 ([#95](https://github.com/npm/cacache/issues/95)) ([fb44f5f](https://github.com/npm/cacache/commit/fb44f5f6bf85f9ee45ba52eb63088b108eca076d))
### [16.0.3](https://github.com/npm/cacache/compare/v16.0.2...v16.0.3) (2022-03-22)
### Dependencies
* bump @npmcli/fs from 1.1.1 to 2.1.0 ([#88](https://github.com/npm/cacache/issues/88)) ([9c9c91c](https://github.com/npm/cacache/commit/9c9c91ce13b941a12c73b95940c5d0b4f4dbf3d0))
* update lru-cache requirement from ^7.5.1 to ^7.7.1 ([#87](https://github.com/npm/cacache/issues/87)) ([800079f](https://github.com/npm/cacache/commit/800079fc5fd18e624bcc53dae3b5f432033e1096))
### [16.0.2](https://www.github.com/npm/cacache/compare/v16.0.1...v16.0.2) (2022-03-16)
### Bug Fixes
* use lru-cache.clear ([#80](https://www.github.com/npm/cacache/issues/80)) ([a48e020](https://www.github.com/npm/cacache/commit/a48e020ca86d28a569578617cc4c7efb76aa8194))
### [16.0.1](https://www.github.com/npm/cacache/compare/v16.0.0...v16.0.1) (2022-03-15)
### Dependencies
* bump lru-cache from 6.0.0 to 7.5.1 ([#77](https://www.github.com/npm/cacache/issues/77)) ([6a3a886](https://www.github.com/npm/cacache/commit/6a3a8863f079aaccb623c4f8d933c485b82e0671))
* update glob requirement from ^7.1.4 to ^7.2.0 ([#74](https://www.github.com/npm/cacache/issues/74)) ([27f1a63](https://www.github.com/npm/cacache/commit/27f1a63cc14de34585330c7ad50f5ae00b3b5b54))
* update minipass requirement from ^3.1.1 to ^3.1.6 ([#76](https://www.github.com/npm/cacache/issues/76)) ([954a430](https://www.github.com/npm/cacache/commit/954a43056fd01ca3a359581dfe32cdfd0ada5f8d))
## [16.0.0](https://www.github.com/npm/cacache/compare/v15.3.0...v16.0.0) (2022-03-14)
### ⚠ BREAKING CHANGES
* this drops support for node10 and non-LTS versions of node12 and node14.
### Bug Fixes
* move files to lib ([cfa4a79](https://www.github.com/npm/cacache/commit/cfa4a7974e1a2b4c4d00613afe20b1925fbe639a))
### Dependencies
* @npmcli/template-oss@2.9.2 ([6e051a7](https://www.github.com/npm/cacache/commit/6e051a782e18288c51914562ae93b4ce52a81ad1))
* update @npmcli/move-file requirement from ^1.0.1 to ^1.1.2 ([#70](https://www.github.com/npm/cacache/issues/70)) ([ddf797a](https://www.github.com/npm/cacache/commit/ddf797a1906e2b285165e544d5ae29a4bb1514ef))
* update fs-minipass requirement from ^2.0.0 to ^2.1.0 ([#72](https://www.github.com/npm/cacache/issues/72)) ([07a5aa1](https://www.github.com/npm/cacache/commit/07a5aa17a8d2245d69f613f9351d4cf84865ade8))
* update minipass-pipeline requirement from ^1.2.2 to ^1.2.4 ([#69](https://www.github.com/npm/cacache/issues/69)) ([372d1a1](https://www.github.com/npm/cacache/commit/372d1a1533aaa8ea37c4cb98f99f40461c9bddac))
* update mkdirp requirement from ^1.0.3 to ^1.0.4 ([#73](https://www.github.com/npm/cacache/issues/73)) ([5fbd50f](https://www.github.com/npm/cacache/commit/5fbd50f1000e8065d754a7c8c89c1c9747532618))
* update tar requirement from ^6.0.2 to ^6.1.11 ([#71](https://www.github.com/npm/cacache/issues/71)) ([4d35625](https://www.github.com/npm/cacache/commit/4d3562565dc52fe51cc5de2fbffceddb63f65118))
## [15.2.0](https://github.com/npm/cacache/releases/v15.2.0) (2021-05-25)
* [8892a92](https://github.com/npm/cacache/commit/8892a92) add a validateEntry option to compact
* [460b951](https://github.com/npm/cacache/commit/460b951) allow fully deleting indexes
## [15.1.0](https://github.com/npm/cacache/compare/v15.0.6...v15.1.0) (2021-05-19)
### Features
* allow formatEntry to keep entries with no integrity value ([930f531](https://github.com/npm/cacache/commit/930f5313825a84277c531defe53696b8c9f4ef70)), closes [#53](https://github.com/npm/cacache/issues/53)
* expose index.insert, implement and expose index.compact ([c4efb74](https://github.com/npm/cacache/commit/c4efb7427cd40694933a46ef3eb59d32ce4d0eed))
### [15.0.6](https://github.com/npm/cacache/compare/v15.0.5...v15.0.6) (2021-03-22)
### [15.0.5](https://github.com/npm/cacache/compare/v15.0.4...v15.0.5) (2020-07-11)
### [15.0.4](https://github.com/npm/cacache/compare/v15.0.3...v15.0.4) (2020-06-03)
### Bug Fixes
* replace move-file dep with @npmcli/move-file ([bf88af0](https://github.com/npm/cacache/commit/bf88af04e50cca9b54041151139ffc1fd415e2dc)), closes [#37](https://github.com/npm/cacache/issues/37)
### [15.0.3](https://github.com/npm/cacache/compare/v15.0.2...v15.0.3) (2020-04-28)
### Bug Fixes
* actually remove move-concurrently dep ([29e6eec](https://github.com/npm/cacache/commit/29e6eec9fee73444ee09daf1c1be06ddd5fe57f6))
### [15.0.2](https://github.com/npm/cacache/compare/v15.0.1...v15.0.2) (2020-04-28)
### Bug Fixes
* tacks should be a dev dependency ([93ec158](https://github.com/npm/cacache/commit/93ec15852f0fdf1753ea7f75b4b8926daf8a7565))
## [15.0.1](https://github.com/npm/cacache/compare/v15.0.0...v15.0.1) (2020-04-27)
* **deps:** Use move-file instead of move-file-concurrently. ([92b125](https://github.com/npm/cacache/commit/92b1251a11b9848878b6c0d101b18bd8845acaa6))
## [15.0.0](https://github.com/npm/cacache/compare/v14.0.0...v15.0.0) (2020-02-18)
### ⚠ BREAKING CHANGES
* drop figgy-pudding and use canonical option names.
### Features
* remove figgy-pudding ([57d11bc](https://github.com/npm/cacache/commit/57d11bce34f979247d1057d258acc204c4944491))
## [14.0.0](https://github.com/npm/cacache/compare/v13.0.1...v14.0.0) (2020-01-28)
### ⚠ BREAKING CHANGES
* **deps:** bumps engines to >= 10
* **deps:** tar v6 and mkdirp v1 ([5a66e7a](https://github.com/npm/cacache/commit/5a66e7a))
### [13.0.1](https://github.com/npm/cacache/compare/v13.0.0...v13.0.1) (2019-09-30)
### Bug Fixes
* **fix-owner:** chownr.sync quits on non-root uid ([08801be](https://github.com/npm/cacache/commit/08801be))
## [13.0.0](https://github.com/npm/cacache/compare/v12.0.3...v13.0.0) (2019-09-25)
### ⚠ BREAKING CHANGES
* This subtly changes the streaming interface of
everything in cacache that streams, which is, well, everything in
cacache. Most users will probably not notice, but any code that
depended on stream behavior always being deferred until next tick will
need to adjust.
The mississippi methods 'to', 'from', 'through', and so on, have been
replaced with their Minipass counterparts, and streaming interaction
with the file system is done via fs-minipass.
The following modules are of interest here:
- [minipass](http://npm.im/minipass) The core stream library.
- [fs-minipass](http://npm.im/fs-minipass) Note that the 'WriteStream'
class from fs-minipass is _not_ a Minipass stream, but rather a plain
old EventEmitter that duck types as a Writable.
- [minipass-collect](http://npm.im/minipass-collect) Gather up all the
data from a stream. Cacache only uses Collect.PassThrough, which is a
basic Minipass passthrough stream which emits a 'collect' event with
the completed data just before the 'end' event.
- [minipass-pipeline](http://npm.im/minipass-pipeline) Connect one or
more streams into a pipe chain. Errors anywhere in the pipeline are
proxied down the chain and then up to the Pipeline object itself.
Writes go into the head, reads go to the tail. Used in place of
pump() and pumpify().
- [minipass-flush](http://npm.im/minipass-flush) A Minipass passthrough
stream that defers its 'end' event until after a flush() method has
completed (either calling the supplied callback, or returning a
promise.) Use in place of flush-write-stream (aka mississippi.to).
Streams from through2, concat-stream, and the behavior provided by
end-of-stream are all implemented in Minipass itself.
Features of interest to cacache, which make Minipass a particularly good
fit:
- All of the 'endish' events are normalized, so we can just listen on
'end' and know that finish, prefinish, and close will be handled as
well.
- Minipass doesn't waste time [containing
zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony).
- Minipass has built-in support for promises that indicate the end or
error: stream.promise(), stream.collect(), and stream.concat().
- With reliable and consistent timing guarantees, much less
error-checking logic is required. We can be more confident that an
error is being thrown or emitted in the correct place, rather than in
a callback which is deferred, resulting in a hung promise or
uncaughtException.
The biggest downside of Minipass is that it lacks some of the internal
characteristics of node-core streams, which many community modules use
to identify streams. They have no _writableState or _readableState
objects, or _read or _write methods. As a result, the is-stream module
(at least, at the time of this commit) doesn't recognize Minipass
streams as readable or writable streams.
All in all, the changes required of downstream users should be minimal,
but are unlikely to be zero. Hence the semver major change.
### Features
* replace all streams with Minipass streams ([f4c0962](https://github.com/npm/cacache/commit/f4c0962))
* **deps:** Add minipass and minipass-pipeline ([a6545a9](https://github.com/npm/cacache/commit/a6545a9))
* **promise:** converted .resolve to native promise, converted .map and .reduce to native ([220c56d](https://github.com/npm/cacache/commit/220c56d))
* **promise:** individually promisifing functions as needed ([74b939e](https://github.com/npm/cacache/commit/74b939e))
* **promise:** moved .reject from bluebird to native promise ([1d56da1](https://github.com/npm/cacache/commit/1d56da1))
* **promise:** removed .fromNode, removed .join ([9c457a0](https://github.com/npm/cacache/commit/9c457a0))
* **promise:** removed .map, replaced with p-map. removed .try ([cc3ee05](https://github.com/npm/cacache/commit/cc3ee05))
* **promise:** removed .tap ([0260f12](https://github.com/npm/cacache/commit/0260f12))
* **promise:** removed .using/.disposer ([5d832f3](https://github.com/npm/cacache/commit/5d832f3))
* **promise:** removed bluebird ([c21298c](https://github.com/npm/cacache/commit/c21298c))
* **promise:** removed bluebird specific .catch calls ([28aeeac](https://github.com/npm/cacache/commit/28aeeac))
* **promise:** replaced .reduce and .mapSeries ([478f5cb](https://github.com/npm/cacache/commit/478f5cb))
### [12.0.3](https://github.com/npm/cacache/compare/v12.0.2...v12.0.3) (2019-08-19)
### Bug Fixes
* do not chown if not running as root ([2d80af9](https://github.com/npm/cacache/commit/2d80af9))
### [12.0.2](https://github.com/npm/cacache/compare/v12.0.1...v12.0.2) (2019-07-19)
### [12.0.1](https://github.com/npm/cacache/compare/v12.0.0...v12.0.1) (2019-07-19)
* **deps** Abstracted out `lib/util/infer-owner.js` to
[@npmcli/infer-owner](https://www.npmjs.com/package/@npmcli/infer-owner)
so that it could be more easily used in other parts of the npm CLI.
## [12.0.0](https://github.com/npm/cacache/compare/v11.3.3...v12.0.0) (2019-07-15)
### Features
* infer uid/gid instead of accepting as options ([ac84d14](https://github.com/npm/cacache/commit/ac84d14))
* **i18n:** add another error message ([676cb32](https://github.com/npm/cacache/commit/676cb32))
### BREAKING CHANGES
* the uid gid options are no longer respected or
necessary. As of this change, cacache will always match the cache
contents to the ownership of the cache directory (or its parent
directory), regardless of what the caller passes in.
Reasoning:
The number one reason to use a uid or gid option was to keep root-owned
files from causing problems in the cache. In npm's case, this meant
that CLI's ./lib/command.js had to work out the appropriate uid and gid,
then pass it to the libnpmcommand module, which had to in turn pass the
uid and gid to npm-registry-fetch, which then passed it to
make-fetch-happen, which passed it to cacache. (For package fetching,
pacote would be in that mix as well.)
Added to that, `cacache.rm()` will actually _write_ a file into the
cache index, but has no way to accept an option so that its call to
entry-index.js will write the index with the appropriate uid/gid.
Little ownership bugs were all over the place, and tricky to trace
through. (Why should make-fetch-happen even care about accepting or
passing uids and gids? It's an http library.)
This change allows us to keep the cache from having mixed ownership in
any situation.
Of course, this _does_ mean that if you have a root-owned but
user-writable folder (for example, `/tmp`), then the cache will try to
chown everything to root.
The solution is for the user to create a folder, make it user-owned, and
use that, rather than relying on cacache to create the root cache folder.
If we decide to restore the uid/gid opts, and use ownership inference
only when uid/gid are unset, then take care to also make rm take an
option object, and pass it through to entry-index.js.
### [11.3.3](https://github.com/npm/cacache/compare/v11.3.2...v11.3.3) (2019-06-17)
### Bug Fixes
* **audit:** npm audit fix ([200a6d5](https://github.com/npm/cacache/commit/200a6d5))
* **config:** Add ssri config 'error' option ([#146](https://github.com/npm/cacache/issues/146)) ([47de8f5](https://github.com/npm/cacache/commit/47de8f5))
* **deps:** npm audit fix ([481a7dc](https://github.com/npm/cacache/commit/481a7dc))
* **standard:** standard --fix ([7799149](https://github.com/npm/cacache/commit/7799149))
* **write:** avoid another cb never called situation ([5156561](https://github.com/npm/cacache/commit/5156561))
## [11.3.2](https://github.com/npm/cacache/compare/v11.3.1...v11.3.2) (2018-12-21)
### Bug Fixes
* **get:** make sure to handle errors in the .then ([b10bcd0](https://github.com/npm/cacache/commit/b10bcd0))
## [11.3.1](https://github.com/npm/cacache/compare/v11.3.0...v11.3.1) (2018-11-05)
### Bug Fixes
* **get:** export hasContent.sync properly ([d76c920](https://github.com/npm/cacache/commit/d76c920))
# [11.3.0](https://github.com/npm/cacache/compare/v11.2.0...v11.3.0) (2018-11-05)
### Features
* **get:** add sync API for reading ([db1e094](https://github.com/npm/cacache/commit/db1e094))
# [11.2.0](https://github.com/npm/cacache/compare/v11.1.0...v11.2.0) (2018-08-08)
### Features
* **read:** add sync support to other internal read.js fns ([fe638b6](https://github.com/npm/cacache/commit/fe638b6))
# [11.1.0](https://github.com/npm/cacache/compare/v11.0.3...v11.1.0) (2018-08-01)
### Features
* **read:** add sync support for low-level content read ([b43af83](https://github.com/npm/cacache/commit/b43af83))
## [11.0.3](https://github.com/npm/cacache/compare/v11.0.2...v11.0.3) (2018-08-01)
### Bug Fixes
* **config:** add ssri config options ([#136](https://github.com/npm/cacache/issues/136)) ([10d5d9a](https://github.com/npm/cacache/commit/10d5d9a))
* **perf:** refactor content.read to avoid lstats ([c5ac10e](https://github.com/npm/cacache/commit/c5ac10e))
* **test:** oops when removing safe-buffer ([1950490](https://github.com/npm/cacache/commit/1950490))
## [11.0.2](https://github.com/npm/cacache/compare/v11.0.1...v11.0.2) (2018-05-07)
### Bug Fixes
* **verify:** size param no longer lost in a verify ([#131](https://github.com/npm/cacache/issues/131)) ([c614a19](https://github.com/npm/cacache/commit/c614a19)), closes [#130](https://github.com/npm/cacache/issues/130)
## [11.0.1](https://github.com/npm/cacache/compare/v11.0.0...v11.0.1) (2018-04-10)
# [11.0.0](https://github.com/npm/cacache/compare/v10.0.4...v11.0.0) (2018-04-09)
### Features
* **opts:** use figgy-pudding for opts ([#128](https://github.com/npm/cacache/issues/128)) ([33d4eed](https://github.com/npm/cacache/commit/33d4eed))
### meta
* drop support for node@4 ([529f347](https://github.com/npm/cacache/commit/529f347))
### BREAKING CHANGES
* node@4 is no longer supported
## [10.0.4](https://github.com/npm/cacache/compare/v10.0.3...v10.0.4) (2018-02-16)
## [10.0.3](https://github.com/npm/cacache/compare/v10.0.2...v10.0.3) (2018-02-16)
### Bug Fixes
* **content:** rethrow aggregate errors as ENOENT ([fa918f5](https://github.com/npm/cacache/commit/fa918f5))
## [10.0.2](https://github.com/npm/cacache/compare/v10.0.1...v10.0.2) (2018-01-07)
### Bug Fixes
* **ls:** deleted entries could cause a premature stream EOF ([347dc36](https://github.com/npm/cacache/commit/347dc36))
## [10.0.1](https://github.com/npm/cacache/compare/v10.0.0...v10.0.1) (2017-11-15)
### Bug Fixes
* **move-file:** actually use the fallback to `move-concurrently` (#110) ([073fbe1](https://github.com/npm/cacache/commit/073fbe1))
# [10.0.0](https://github.com/npm/cacache/compare/v9.3.0...v10.0.0) (2017-10-23)
### Features
* **license:** relicense to ISC (#111) ([fdbb4e5](https://github.com/npm/cacache/commit/fdbb4e5))
### Performance Improvements
* more copyFile benchmarks ([63787bb](https://github.com/npm/cacache/commit/63787bb))
### BREAKING CHANGES
* **license:** the license has been changed from CC0-1.0 to ISC.
# [9.3.0](https://github.com/npm/cacache/compare/v9.2.9...v9.3.0) (2017-10-07)
### Features
* **copy:** added cacache.get.copy api for fast copies (#107) ([067b5f6](https://github.com/npm/cacache/commit/067b5f6))
## [9.2.9](https://github.com/npm/cacache/compare/v9.2.8...v9.2.9) (2017-06-17)
## [9.2.8](https://github.com/npm/cacache/compare/v9.2.7...v9.2.8) (2017-06-05)
### Bug Fixes
* **ssri:** bump ssri for bugfix ([c3232ea](https://github.com/npm/cacache/commit/c3232ea))
## [9.2.7](https://github.com/npm/cacache/compare/v9.2.6...v9.2.7) (2017-06-05)
### Bug Fixes
* **content:** make verified content completely read-only (#96) ([4131196](https://github.com/npm/cacache/commit/4131196))
## [9.2.6](https://github.com/npm/cacache/compare/v9.2.5...v9.2.6) (2017-05-31)
### Bug Fixes
* **node:** update ssri to prevent old node 4 crash ([5209ffe](https://github.com/npm/cacache/commit/5209ffe))
## [9.2.5](https://github.com/npm/cacache/compare/v9.2.4...v9.2.5) (2017-05-25)
### Bug Fixes
* **deps:** fix lockfile issues and bump ssri ([84e1d7e](https://github.com/npm/cacache/commit/84e1d7e))
## [9.2.4](https://github.com/npm/cacache/compare/v9.2.3...v9.2.4) (2017-05-24)
### Bug Fixes
* **deps:** bumping deps ([bbccb12](https://github.com/npm/cacache/commit/bbccb12))
## [9.2.3](https://github.com/npm/cacache/compare/v9.2.2...v9.2.3) (2017-05-24)
### Bug Fixes
* **rm:** stop crashing if content is missing on rm ([ac90bc0](https://github.com/npm/cacache/commit/ac90bc0))
## [9.2.2](https://github.com/npm/cacache/compare/v9.2.1...v9.2.2) (2017-05-14)
### Bug Fixes
* **i18n:** lets pretend this didn't happen ([519b4ee](https://github.com/npm/cacache/commit/519b4ee))
## [9.2.1](https://github.com/npm/cacache/compare/v9.2.0...v9.2.1) (2017-05-14)
### Bug Fixes
* **docs:** fixing translation messup ([bb9e4f9](https://github.com/npm/cacache/commit/bb9e4f9))
# [9.2.0](https://github.com/npm/cacache/compare/v9.1.0...v9.2.0) (2017-05-14)
### Features
* **i18n:** add Spanish translation for API ([531f9a4](https://github.com/npm/cacache/commit/531f9a4))
# [9.1.0](https://github.com/npm/cacache/compare/v9.0.0...v9.1.0) (2017-05-14)
### Features
* **i18n:** Add Spanish translation and i18n setup (#91) ([323b90c](https://github.com/npm/cacache/commit/323b90c))
# [9.0.0](https://github.com/npm/cacache/compare/v8.0.0...v9.0.0) (2017-04-28)
### Bug Fixes
* **memoization:** actually use the LRU ([0e55dc9](https://github.com/npm/cacache/commit/0e55dc9))
### Features
* **memoization:** memoizers can be injected through opts.memoize (#90) ([e5614c7](https://github.com/npm/cacache/commit/e5614c7))
### BREAKING CHANGES
* **memoization:** If you were passing an object to opts.memoize, it will now be used as an injected memoization object. If you were only passing booleans and other non-objects through that option, no changes are needed.
# [8.0.0](https://github.com/npm/cacache/compare/v7.1.0...v8.0.0) (2017-04-22)
### Features
* **read:** change hasContent to return {sri, size} (#88) ([bad6c49](https://github.com/npm/cacache/commit/bad6c49)), closes [#87](https://github.com/npm/cacache/issues/87)
### BREAKING CHANGES
* **read:** hasContent now returns an object with `{sri, size}` instead of `sri`. Use `result.sri` anywhere that needed the old return value.
# [7.1.0](https://github.com/npm/cacache/compare/v7.0.5...v7.1.0) (2017-04-20)
### Features
* **size:** handle content size info (#49) ([91230af](https://github.com/npm/cacache/commit/91230af))
## [7.0.5](https://github.com/npm/cacache/compare/v7.0.4...v7.0.5) (2017-04-18)
### Bug Fixes
* **integrity:** new ssri with fixed integrity stream ([6d13e8e](https://github.com/npm/cacache/commit/6d13e8e))
* **write:** wrap stuff in promises to improve errors ([3624fc5](https://github.com/npm/cacache/commit/3624fc5))
## [7.0.4](https://github.com/npm/cacache/compare/v7.0.3...v7.0.4) (2017-04-15)
### Bug Fixes
* **fix-owner:** throw away ENOENTs on chownr ([d49bbcd](https://github.com/npm/cacache/commit/d49bbcd))
## [7.0.3](https://github.com/npm/cacache/compare/v7.0.2...v7.0.3) (2017-04-05)
### Bug Fixes
* **read:** fixing error message for integrity verification failures ([9d4f0a5](https://github.com/npm/cacache/commit/9d4f0a5))
## [7.0.2](https://github.com/npm/cacache/compare/v7.0.1...v7.0.2) (2017-04-03)
### Bug Fixes
* **integrity:** use EINTEGRITY error code and update ssri ([8dc2e62](https://github.com/npm/cacache/commit/8dc2e62))
## [7.0.1](https://github.com/npm/cacache/compare/v7.0.0...v7.0.1) (2017-04-03)
### Bug Fixes
* **docs:** fix header name conflict in readme ([afcd456](https://github.com/npm/cacache/commit/afcd456))
# [7.0.0](https://github.com/npm/cacache/compare/v6.3.0...v7.0.0) (2017-04-03)
### Bug Fixes
* **test:** fix content.write tests when running in docker ([d2e9b6a](https://github.com/npm/cacache/commit/d2e9b6a))
### Features
* **integrity:** subresource integrity support (#78) ([b1e731f](https://github.com/npm/cacache/commit/b1e731f))
### BREAKING CHANGES
* **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`](https://npm.im/ssri).
* 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.
* `cacache.get.info()`, `cacache.ls()`, and `cacache.ls.stream()` will now return objects that looks like this:
```
{
key: String,
integrity: '-',
path: ContentPath,
time: Date,
metadata: Any
}
```
* `opts.digest` and `opts.hashAlgorithm` are obsolete for any API calls that used them.
* 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).
* `put.byDigest()`, `put.stream.byDigest`, `get.byDigest()` and `get.stream.byDigest()` now expect an SRI instead of a `digest` + `opts.hashAlgorithm` pairing.
* `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.
* `verify()` has learned to handle integrity-based caches, and forgotten how to handle old-style cache indices due to the format change.
* `cacache.rm.content()` now expects an integrity hash instead of a hex digest.
# [6.3.0](https://github.com/npm/cacache/compare/v6.2.0...v6.3.0) (2017-04-01)
### Bug Fixes
* **fixOwner:** ignore EEXIST race condition from mkdirp ([4670e9b](https://github.com/npm/cacache/commit/4670e9b))
* **index:** ignore index removal races when inserting ([b9d2fa2](https://github.com/npm/cacache/commit/b9d2fa2))
* **memo:** use lru-cache for better mem management (#75) ([d8ac5aa](https://github.com/npm/cacache/commit/d8ac5aa))
### Features
* **dependencies:** Switch to move-concurrently (#77) ([dc6482d](https://github.com/npm/cacache/commit/dc6482d))
# [6.2.0](https://github.com/npm/cacache/compare/v6.1.2...v6.2.0) (2017-03-15)
### Bug Fixes
* **index:** additional bucket entry verification with checksum (#72) ([f8e0f25](https://github.com/npm/cacache/commit/f8e0f25))
* **verify:** return fixOwner.chownr promise ([6818521](https://github.com/npm/cacache/commit/6818521))
### Features
* **tmp:** safe tmp dir creation/management util (#73) ([c42da71](https://github.com/npm/cacache/commit/c42da71))
## [6.1.2](https://github.com/npm/cacache/compare/v6.1.1...v6.1.2) (2017-03-13)
### Bug Fixes
* **index:** set default hashAlgorithm ([d6eb2f0](https://github.com/npm/cacache/commit/d6eb2f0))
## [6.1.1](https://github.com/npm/cacache/compare/v6.1.0...v6.1.1) (2017-03-13)
### Bug Fixes
* **coverage:** bumping coverage for verify (#71) ([0b7faf6](https://github.com/npm/cacache/commit/0b7faf6))
* **deps:** glob should have been a regular dep :< ([0640bc4](https://github.com/npm/cacache/commit/0640bc4))
# [6.1.0](https://github.com/npm/cacache/compare/v6.0.2...v6.1.0) (2017-03-12)
### Bug Fixes
* **coverage:** more coverage for content reads (#70) ([ef4f70a](https://github.com/npm/cacache/commit/ef4f70a))
* **tests:** use safe-buffer because omfg (#69) ([6ab8132](https://github.com/npm/cacache/commit/6ab8132))
### Features
* **rm:** limited rm.all and fixed bugs (#66) ([d5d25ba](https://github.com/npm/cacache/commit/d5d25ba)), closes [#66](https://github.com/npm/cacache/issues/66)
* **verify:** tested, working cache verifier/gc (#68) ([45ad77a](https://github.com/npm/cacache/commit/45ad77a))
## [6.0.2](https://github.com/npm/cacache/compare/v6.0.1...v6.0.2) (2017-03-11)
### Bug Fixes
* **index:** segment cache items with another subbucket (#64) ([c3644e5](https://github.com/npm/cacache/commit/c3644e5))
## [6.0.1](https://github.com/npm/cacache/compare/v6.0.0...v6.0.1) (2017-03-05)
### Bug Fixes
* **docs:** Missed spots in README ([8ffb7fa](https://github.com/npm/cacache/commit/8ffb7fa))
# [6.0.0](https://github.com/npm/cacache/compare/v5.0.3...v6.0.0) (2017-03-05)
### Bug Fixes
* **api:** keep memo cache mostly-internal ([2f72d0a](https://github.com/npm/cacache/commit/2f72d0a))
* **content:** use the rest of the string, not the whole string ([fa8f3c3](https://github.com/npm/cacache/commit/fa8f3c3))
* **deps:** removed `format-number@2.0.2` ([1187791](https://github.com/npm/cacache/commit/1187791))
* **deps:** removed inflight@1.0.6 ([0d1819c](https://github.com/npm/cacache/commit/0d1819c))
* **deps:** rimraf@2.6.1 ([9efab6b](https://github.com/npm/cacache/commit/9efab6b))
* **deps:** standard@9.0.0 ([4202cba](https://github.com/npm/cacache/commit/4202cba))
* **deps:** tap@10.3.0 ([aa03088](https://github.com/npm/cacache/commit/aa03088))
* **deps:** weallcontribute@1.0.8 ([ad4f4dc](https://github.com/npm/cacache/commit/ad4f4dc))
* **docs:** add security note to hashKey ([03f81ba](https://github.com/npm/cacache/commit/03f81ba))
* **hashes:** change default hashAlgorithm to sha512 ([ea00ba6](https://github.com/npm/cacache/commit/ea00ba6))
* **hashes:** missed a spot for hashAlgorithm defaults ([45997d8](https://github.com/npm/cacache/commit/45997d8))
* **index:** add length header before JSON for verification ([fb8cb4d](https://github.com/npm/cacache/commit/fb8cb4d))
* **index:** change index filenames to sha1s of keys ([bbc5fca](https://github.com/npm/cacache/commit/bbc5fca))
* **index:** who cares about race conditions anyway ([b1d3888](https://github.com/npm/cacache/commit/b1d3888))
* **perf:** bulk-read get+read for massive speed ([d26cdf9](https://github.com/npm/cacache/commit/d26cdf9))
* **perf:** use bulk file reads for index reads ([79a8891](https://github.com/npm/cacache/commit/79a8891))
* **put-stream:** remove tmp file on stream insert error ([65f6632](https://github.com/npm/cacache/commit/65f6632))
* **put-stream:** robustified and predictibilized ([daf9e08](https://github.com/npm/cacache/commit/daf9e08))
* **put-stream:** use new promise API for moves ([1d36013](https://github.com/npm/cacache/commit/1d36013))
* **readme:** updated to reflect new default hashAlgo ([c60a2fa](https://github.com/npm/cacache/commit/c60a2fa))
* **verify:** tiny typo fix ([db22d05](https://github.com/npm/cacache/commit/db22d05))
### Features
* **api:** converted external api ([7bf032f](https://github.com/npm/cacache/commit/7bf032f))
* **cacache:** exported clearMemoized() utility ([8d2c5b6](https://github.com/npm/cacache/commit/8d2c5b6))
* **cache:** add versioning to content and index ([31bc549](https://github.com/npm/cacache/commit/31bc549))
* **content:** collate content files into subdirs ([c094d9f](https://github.com/npm/cacache/commit/c094d9f))
* **deps:** `@npmcorp/move@1.0.0` ([bdd00bf](https://github.com/npm/cacache/commit/bdd00bf))
* **deps:** `bluebird@3.4.7` ([3a17aff](https://github.com/npm/cacache/commit/3a17aff))
* **deps:** `promise-inflight@1.0.1` ([a004fe6](https://github.com/npm/cacache/commit/a004fe6))
* **get:** added memoization support for get ([c77d794](https://github.com/npm/cacache/commit/c77d794))
* **get:** export hasContent ([2956ec3](https://github.com/npm/cacache/commit/2956ec3))
* **index:** add hashAlgorithm and format insert ret val ([b639746](https://github.com/npm/cacache/commit/b639746))
* **index:** collate index files into subdirs ([e8402a5](https://github.com/npm/cacache/commit/e8402a5))
* **index:** promisify entry index ([cda3335](https://github.com/npm/cacache/commit/cda3335))
* **memo:** added memoization lib ([da07b92](https://github.com/npm/cacache/commit/da07b92))
* **memo:** export memoization api ([954b1b3](https://github.com/npm/cacache/commit/954b1b3))
* **move-file:** add move fallback for weird errors ([5cf4616](https://github.com/npm/cacache/commit/5cf4616))
* **perf:** bulk content write api ([51b536e](https://github.com/npm/cacache/commit/51b536e))
* **put:** added memoization support to put ([b613a70](https://github.com/npm/cacache/commit/b613a70))
* **read:** switched to promises ([a869362](https://github.com/npm/cacache/commit/a869362))
* **rm:** added memoization support to rm ([4205cf0](https://github.com/npm/cacache/commit/4205cf0))
* **rm:** switched to promises ([a000d24](https://github.com/npm/cacache/commit/a000d24))
* **util:** promise-inflight ownership fix requests ([9517cd7](https://github.com/npm/cacache/commit/9517cd7))
* **util:** use promises for api ([ae204bb](https://github.com/npm/cacache/commit/ae204bb))
* **verify:** converted to Promises ([f0b3974](https://github.com/npm/cacache/commit/f0b3974))
### BREAKING CHANGES
* cache: index/content directories are now versioned. Previous caches are no longer compatible and cannot be migrated.
* util: fix-owner now uses Promises instead of callbacks
* index: Previously-generated index entries are no longer compatible and the index must be regenerated.
* index: The index format has changed and previous caches are no longer compatible. Existing caches will need to be regenerated.
* hashes: Default hashAlgorithm changed from sha1 to sha512. If you
rely on the prior setting, pass `opts.hashAlgorithm` in explicitly.
* content: Previously-generated content directories are no longer compatible
and must be regenerated.
* verify: API is now promise-based
* read: Switches to a Promise-based API and removes callback stuff
* rm: Switches to a Promise-based API and removes callback stuff
* index: this changes the API to work off promises instead of callbacks
* api: this means we are going all in on promises now
npm-cacache-35d6f44/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000507 15156554446 0017032 0 ustar 00root root 0000000 0000000
All interactions in this repo are covered by the [npm Code of
Conduct](https://docs.npmjs.com/policies/conduct)
The npm cli team may, at its own discretion, moderate, remove, or edit
any interactions such as pull requests, issues, and comments.
npm-cacache-35d6f44/CONTRIBUTING.md 0000664 0000000 0000000 00000005133 15156554446 0016464 0 ustar 00root root 0000000 0000000
# Contributing
## Code of Conduct
All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct).
## Reporting Bugs
Before submitting a new bug report please search for an existing or similar report.
Use one of our existing issue templates if you believe you've come across a unique problem.
Duplicate issues, or issues that don't use one of our templates may get closed without a response.
## Pull Request Conventions
### Commits
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
- `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published.
- `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published.
- `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published.
- `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version).
### Test Coverage
Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR.
Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops.
### Linting
Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically.
Please make sure linting passes before submitting a PR.
## What _not_ to contribute?
### Dependencies
It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
### Tools/Automation
Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted.
npm-cacache-35d6f44/LICENSE.md 0000664 0000000 0000000 00000001363 15156554446 0015640 0 ustar 00root root 0000000 0000000 ISC License
Copyright (c) npm, Inc.
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
USE OR PERFORMANCE OF THIS SOFTWARE.
npm-cacache-35d6f44/README.md 0000664 0000000 0000000 00000054273 15156554446 0015523 0 ustar 00root root 0000000 0000000 # cacache [](https://npm.im/cacache) [](https://npm.im/cacache) [](https://travis-ci.org/npm/cacache) [](https://ci.appveyor.com/project/npm/cacache) [](https://coveralls.io/github/npm/cacache?branch=latest)
[`cacache`](https://github.com/npm/cacache) is a Node.js library for managing
local key and content address caches. It's really fast, really good at
concurrency, and it will never give you corrupted data, even if cache files
get corrupted or manipulated.
On systems that support user and group settings on files, cacache will
match the `uid` and `gid` values to the folder where the cache lives, even
when running as `root`.
It was written to be used as [npm](https://npm.im)'s local cache, but can
just as easily be used on its own.
## Install
`$ npm install --save cacache`
## Table of Contents
* [Example](#example)
* [Features](#features)
* [Contributing](#contributing)
* [API](#api)
* [Using localized APIs](#localized-api)
* Reading
* [`ls`](#ls)
* [`ls.stream`](#ls-stream)
* [`get`](#get-data)
* [`get.stream`](#get-stream)
* [`get.info`](#get-info)
* [`get.hasContent`](#get-hasContent)
* Writing
* [`put`](#put-data)
* [`put.stream`](#put-stream)
* [`rm.all`](#rm-all)
* [`rm.entry`](#rm-entry)
* [`rm.content`](#rm-content)
* [`index.compact`](#index-compact)
* [`index.insert`](#index-insert)
* Utilities
* [`clearMemoized`](#clear-memoized)
* [`tmp.mkdir`](#tmp-mkdir)
* [`tmp.withTmp`](#with-tmp)
* Integrity
* [Subresource Integrity](#integrity)
* [`verify`](#verify)
* [`verify.lastRun`](#verify-last-run)
### Example
```javascript
const cacache = require('cacache')
const fs = require('fs')
const cachePath = '/tmp/my-toy-cache'
const key = 'my-unique-key-1234'
// Cache it! Use `cachePath` as the root of the content cache
cacache.put(cachePath, key, '10293801983029384').then(integrity => {
console.log(`Saved content to ${cachePath}.`)
})
const destination = '/tmp/mytar.tgz'
// Copy the contents out of the cache and into their destination!
// But this time, use stream instead!
cacache.get.stream(
cachePath, key
).pipe(
fs.createWriteStream(destination)
).on('finish', () => {
console.log('done extracting!')
})
// 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!')
})
})
```
### Features
* Extraction by key or by content address (shasum, etc)
* [Subresource Integrity](#integrity) web standard support
* Multi-hash support - safely host sha1, sha512, etc, in a single cache
* Automatic content deduplication
* Fault tolerance (immune to corruption, partial writes, process races, etc)
* Consistency guarantees on read and write (full data verification)
* Lockless, high-concurrency cache access
* Streaming support
* Promise support
* Fast -- sub-millisecond reads and writes including verification
* Arbitrary metadata storage
* Garbage collection and additional offline verification
* Thorough test coverage
* There's probably a bloom filter in there somewhere. Those are cool, right? 🤔
### Contributing
The 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.
All 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.
Please refer to the [Changelog](CHANGELOG.md) for project history details, too.
Happy hacking!
### API
#### `> cacache.ls(cache) -> Promise