summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/fetchers/registry/index.js
blob: 2cca7040bda4ae4bf31c3eee4044b925c94c27fb (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
28
29
30
31
32
'use strict'

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

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

Fetcher.impl(fetchRegistry, {
  packument (spec, opts) {
    return regPackument(spec, opts)
  },

  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()
    regPackument.clearMemoized()
  }
})