summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cacache/lib/content/rm.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cacache/lib/content/rm.js')
-rw-r--r--deps/npm/node_modules/cacache/lib/content/rm.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/deps/npm/node_modules/cacache/lib/content/rm.js b/deps/npm/node_modules/cacache/lib/content/rm.js
new file mode 100644
index 0000000000..a8903dc0e3
--- /dev/null
+++ b/deps/npm/node_modules/cacache/lib/content/rm.js
@@ -0,0 +1,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))
+ }
+ })
+}