The task we want to accomplish in this example is, given a URL and a file system path, download the document content and save it in the file system.
Let's begin our example by using the modules request
and fs
to perform the task directly:
const request = require('request')
const fs = require('fs')