This creates a d.ts file so you can use it in your typescript project. Used by sern CLI.
d.ts
npm install download-file-new
var download = require('dl-file-new') var url = "http://i.imgur.com/G9bDaPH.jpg" var options = { directory: "./images/cats/", filename: "cat.gif" } download(url, options, function(err){ if (err) throw err console.log("meow") })
url string of the file URL to download
options object with options
callback function to run after