Merge pull request #28256 from dobesv/unzipper-open-buffer

unzipper: Add unzipper.Open.buffer
This commit is contained in:
Daniel Rosenwasser
2018-08-22 12:58:12 -07:00
committed by GitHub
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for unzipper 0.8
// Type definitions for unzipper 0.9
// Project: https://github.com/ZJONSSON/node-unzipper#readme
// Definitions by: s73obrien <https://github.com/s73obrien>
// Nate <https://github.com/natemara>
@@ -57,6 +57,7 @@ export function unzip(
): Entry;
export namespace Open {
function buffer(data: Buffer): Promise<CentralDirectory>;
function file(filename: string): Promise<CentralDirectory>;
function url(
request: ClientRequest,
+1
View File
@@ -41,3 +41,4 @@ createReadStream("http://example.org/path/to/archive.zip")
const dir1: Promise<CentralDirectory> = Open.file("Z:\\path\\to\\archive.zip");
const dir2: Promise<CentralDirectory> = Open.url(get("url/to/archive.zip"), {});
const dir3: Promise<CentralDirectory> = Open.s3("any", "any");
const dir4: Promise<CentralDirectory> = Open.buffer(Buffer.from('ZIPDATA'));