Sha256: 7ec9682ee3472435d866bdd35d18e2d570ffe98621bc230f30d31443bd04d8f7

Contents?: true

Size: 737 Bytes

Versions: 84

Compression:

Stored size: 737 Bytes

Contents

'use strict'

const contentVer = require('../../package.json')['cache-version'].content
const hashToSegments = require('../util/hash-to-segments')
const path = require('path')
const ssri = require('ssri')

// Current format of content file path:
//
// sha512-BaSE64Hex= ->
// ~/.my-cache/content-v2/sha512/ba/da/55deadbeefc0ffee
//
module.exports = contentPath

function contentPath (cache, integrity) {
  const sri = ssri.parse(integrity, { single: true })
  // contentPath is the *strongest* algo given
  return path.join(
    contentDir(cache),
    sri.algorithm,
    ...hashToSegments(sri.hexDigest())
  )
}

module.exports.contentDir = contentDir

function contentDir (cache) {
  return path.join(cache, `content-v${contentVer}`)
}

Version data entries

84 entries across 50 versions & 6 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/cacache/lib/content/path.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/cacache/lib/content/path.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.60 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.60 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.59 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.59 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.58 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.58 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.57 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.57 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.56 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.56 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.55 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.55 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.54 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.54 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.53 node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.53 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/lib/content/path.js
immosquare-cleaner-0.1.52 node_modules/cacache/lib/content/path.js