Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rm.js « content « lib « cacache « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8903dc0e35ce3bacf02f129f74c3d05bc3e02f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict'

const BB = require('bluebird')

const contentPath = require('./path')
const hasContent = require('./read').hasContent
const rimraf = BB.promisify(require('rimraf'))

module.exports = rm
function rm (cache, integrity) {
  return hasContent(cache, integrity).then(content => {
    const sri = content.sri
    if (sri) {
      return rimraf(contentPath(cache, sri))
    }
  })
}