If you want to obtain a file in NodeJS with out utilizing any third celebration libraries, then you are able to do the next.
The NodeJS ecosystem comes with a fs
module, that is to indicate the FileSystem in-built library.
First declare your imports:
const http = require('https');
const fs = require('fs');
Now you need to use the https
module to obtain a file, and write it to a stream utilizing fs
.
const https = require("https");
const fs = require("fs");
const endpoint = "https://instance/information/some_csv_file";
https.get(endpoint, (res) => {
const file_name = "the_csv.csv";
const writeStream = fs.createWriteStream(file_name);
});