index.js 808 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. const tarball = (spec, opts) => get(spec, opts).tarball()
  8. tarball.stream = (spec, handler, opts) => get(spec, opts).tarballStream(handler)
  9. tarball.file = (spec, dest, opts) => get(spec, opts).tarballFile(dest)
  10. module.exports = {
  11. GitFetcher,
  12. RegistryFetcher,
  13. FileFetcher,
  14. DirFetcher,
  15. RemoteFetcher,
  16. resolve: (spec, opts) => get(spec, opts).resolve(),
  17. extract: (spec, dest, opts) => get(spec, opts).extract(dest),
  18. manifest: (spec, opts) => get(spec, opts).manifest(),
  19. packument: (spec, opts) => get(spec, opts).packument(),
  20. tarball,
  21. }