Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (34 sloc) 1.64 KB


Node module to download a complete html webpage.

Downloads a complete a webpage, including all resources referenced by src tags.


You can install pagedownloader using the Node Package Manager (npm):

npm install pagedownloader

How to use, [content], directory, [callback]);


  • url: The baseurl where the main page you want to download resides.
  • content: (optional) The content of page. If you pass it, that content is used. Otherwise, the url parameter is used to get its content using a HTTP GET request.
  • directory: the directory on your local machine to store the page.
  • callback(err, res): (optional) A callback function which is called when the download is complete. res contains the location of the downloaded files.


var pagedownloader = require('pagedownloader');"", __dirname + '/github1', function (err, res){
    if(err) return console.log(err.stack);


// without callback"", __dirname + '/github2');

Example with the html content already provided

var pagedownloader = require('pagedownloader');"", '<html><img src="images/srpr/logo3w.png" /></html>',  __dirname + '/google1', function (err, res){
    if(err) return console.log(err);


// without callback:"", '<html><img src="images/srpr/logo3w.png" /></html>',  __dirname + '/google2');