• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2
3const cacache = require('cacache')
4const Fetcher = require('../../fetch')
5const regManifest = require('./manifest')
6const regPackument = require('./packument')
7const regTarball = require('./tarball')
8
9const fetchRegistry = module.exports = Object.create(null)
10
11Fetcher.impl(fetchRegistry, {
12  packument (spec, opts) {
13    return regPackument(spec, opts)
14  },
15
16  manifest (spec, opts) {
17    return regManifest(spec, opts)
18  },
19
20  tarball (spec, opts) {
21    return regTarball(spec, opts)
22  },
23
24  fromManifest (manifest, spec, opts) {
25    return regTarball.fromManifest(manifest, spec, opts)
26  },
27
28  clearMemoized () {
29    cacache.clearMemoized()
30    regPackument.clearMemoized()
31  }
32})
33