summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/fetchers/registry/index.js
blob: 78bdc23426b68f9fb588c8e61e1b66b2ea7f96ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict'

const cacache = require('cacache')
const Fetcher = require('../../fetch')
const regManifest = require('./manifest')
const regTarball = require('./tarball')

const fetchRegistry = module.exports = Object.create(null)

Fetcher.impl(fetchRegistry, {
  manifest (spec, opts) {
    return regManifest(spec, opts)
  },

  tarball (spec, opts) {
    return regTarball(spec, opts)
  },

  fromManifest (manifest, spec, opts) {
    return regTarball.fromManifest(manifest, spec, opts)
  },

  clearMemoized () {
    cacache.clearMemoized()
    regManifest.clearMemoized()
  }
})