@definitelytyped/utils
Advanced tools
Comparing version 0.0.57 to 0.0.58-next.2
/// <reference types="node" /> | ||
import "./types/fstream"; | ||
import { FS } from "./fs"; | ||
import { LoggerWithErrors } from "./logging"; | ||
export declare function readFile(path: string): Promise<string>; | ||
@@ -33,3 +34,3 @@ export declare function readFileSync(path: string): string; | ||
export declare const npmInstallFlags = "--ignore-scripts --no-shrinkwrap --no-package-lock --no-bin-links --no-save"; | ||
export declare function downloadAndExtractFile(url: string): Promise<FS>; | ||
export declare function downloadAndExtractFile(url: string, log: LoggerWithErrors): Promise<FS>; | ||
export declare function gzip(input: NodeJS.ReadableStream): NodeJS.ReadableStream; | ||
@@ -36,0 +37,0 @@ export declare function unGzip(input: NodeJS.ReadableStream): NodeJS.ReadableStream; |
@@ -167,3 +167,3 @@ "use strict"; | ||
exports.npmInstallFlags = "--ignore-scripts --no-shrinkwrap --no-package-lock --no-bin-links --no-save"; | ||
function downloadAndExtractFile(url) { | ||
function downloadAndExtractFile(url, log) { | ||
return new Promise((resolve, reject) => { | ||
@@ -180,4 +180,6 @@ const root = new fs_1.Dir(undefined); | ||
} | ||
log.info("Requesting " + url); | ||
https_1.default | ||
.get(url, { timeout: 1000000 }, response => { | ||
log.info("Getting " + url); | ||
const extract = tar_stream_1.default.extract(); | ||
@@ -205,2 +207,3 @@ response.pipe(zlib_1.default.createGunzip()).pipe(extract); | ||
extract.on("finish", () => { | ||
log.info("Done receiving " + url); | ||
resolve(new fs_1.InMemoryFS(root.finish(), "")); | ||
@@ -207,0 +210,0 @@ }); |
{ | ||
"name": "@definitelytyped/utils", | ||
"version": "0.0.57", | ||
"version": "0.0.58-next.2", | ||
"description": "Shared utilities for DefinitelyTyped tools", | ||
@@ -40,3 +40,3 @@ "homepage": "https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/utils#readme", | ||
}, | ||
"gitHead": "313dd241acdb9bf7c9f5abbddabdf0bc381b1b0b" | ||
"gitHead": "6d083a5041fac60523434adddd5d15583168e888" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132257
2081