@jahed/terraform
Version:
A wrapper which downloads and runs Terraform locally via npm.
13 lines (12 loc) • 435 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = download;
const debug_1 = require("./debug");
async function download(url) {
(0, debug_1.debug)("downloading", { url });
const response = await fetch(url);
if (response.status !== 200) {
throw new Error(`download status was not okay (${response.status})`);
}
return Buffer.from(await response.arrayBuffer());
}