Skip to content

Instantly share code, notes, and snippets.

View GypsyDangerous's full-sized avatar
🖥️
Coding

David Snyder GypsyDangerous

🖥️
Coding
View GitHub Profile
@GypsyDangerous
GypsyDangerous / download_file.ts
Created November 6, 2020 14:19
code snippet to download a file from a url in node with typescript
import fs from "fs";
import request from "request"
const download = (uri: string, filename: string, callback: Function) =>{
request.head(uri, function(err, res, body){
console.log('content-type:', res.headers['content-type']);
console.log('content-length:', res.headers['content-length']);
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
*, *::after, *::after{
box-sizing: border-box;
}
button, input, optgroup, select, textarea{
font-family: inherit;
}
a{
color: inherit;
0.0.0.0 foxnews.com
0.0.0.0 noi.org
0.0.0.0 www.freedomphone.com
0.0.0.0 freedomphone.com