Skip to content

Instantly share code, notes, and snippets.

@JamesGelok
Created December 27, 2021 21:21
Show Gist options
  • Save JamesGelok/1124014810d2862850bfd7d96ac43c70 to your computer and use it in GitHub Desktop.
Save JamesGelok/1124014810d2862850bfd7d96ac43c70 to your computer and use it in GitHub Desktop.
Download List of All Node Pakcages
const fs = require("fs");
const https = require("https");
https
.get("https://replicate.npmjs.com/_all_docs", (resp) => {
let chunkNum = 0;
let stream = fs.createWriteStream("./append.txt", { flags: "a" });
console.log(new Date().toISOString());
// A chunk of data has been received.
resp.on("data", (chunk) => {
stream.write(chunk);
chunkNum++;
});
// The whole response has been received. Print out the result.
resp.on("end", () => {
stream.end();
console.log(new Date().toISOString());
console.log("$$$$$$$$$$$$$$$$$$$$$$ DONE $$$$$$$$$$$$$$$$$$$$$$");
});
})
.on("error", (err) => {
console.log("Error: " + err.message);
console.log("---------------------- ERROR ----------------------");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment