DefinitelyTyped/types/pacote/tarball.d.ts
Joel Spadin 25fe77861d Add types npm-registry-fetch, libnpmsearch, and pacote (#38376)
* Add types for npm-registry-fetch

* Add types for libnpmsearch

* Add types for pacote

* Use ReadonlyArray in libnpmsearch

* pacote: Reorganize imports/exports
2019-09-25 09:37:07 -07:00

24 lines
719 B
TypeScript

import { Options } from './index';
import { PassThrough } from 'stream';
/**
* Fetches package data identified by `spec` and returns the data as a buffer.
*/
declare function tarball(spec: string, opts?: Options): Promise<Buffer>;
declare namespace tarball {
/**
* Same as `pacote.tarball`, except it returns a stream instead of a Promise.
*/
function stream(spec: string, opts?: Options): PassThrough;
/**
* Like `pacote.tarball`, but instead of returning data directly, data will
* be written directly to `dest`, and create any required directories along
* the way.
*/
function toFile(spec: string, dest: string, opts?: Options): Promise<void>;
}
export = tarball;