index.js 826 B

1234567891011121314151617181920212223
  1. const { get } = require('./fetcher.js')
  2. const GitFetcher = require('./git.js')
  3. const RegistryFetcher = require('./registry.js')
  4. const FileFetcher = require('./file.js')
  5. const DirFetcher = require('./dir.js')
  6. const RemoteFetcher = require('./remote.js')
  7. module.exports = {
  8. GitFetcher,
  9. RegistryFetcher,
  10. FileFetcher,
  11. DirFetcher,
  12. RemoteFetcher,
  13. resolve: (spec, opts) => get(spec, opts).resolve(),
  14. extract: (spec, dest, opts) => get(spec, opts).extract(dest),
  15. manifest: (spec, opts) => get(spec, opts).manifest(),
  16. tarball: (spec, opts) => get(spec, opts).tarball(),
  17. packument: (spec, opts) => get(spec, opts).packument(),
  18. }
  19. module.exports.tarball.stream = (spec, handler, opts) =>
  20. get(spec, opts).tarballStream(handler)
  21. module.exports.tarball.file = (spec, dest, opts) =>
  22. get(spec, opts).tarballFile(dest)