Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pagedownloader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagedownloader

Node module to download a complete html webpage

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-download-complete-page

Node module to download a complete html webpage.

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

Install

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

npm install pagedownloader

How to use

pagedownloader.download(url, [content], directory, [callback]);

Arguments

  • 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.

Example

var pagedownloader = require('pagedownloader');

pagedownloader.download("https://github.com/", __dirname + '/github1', function (err, res){
    if(err) return console.log(err.stack);

    console.log(res);
});

// without callback
pagedownloader.download("https://github.com/", __dirname + '/github2');

Example with the html content already provided

var pagedownloader = require('pagedownloader');

pagedownloader.download("https://www.google.com/", '<html><img src="images/srpr/logo3w.png" /></html>',  __dirname + '/google1', function (err, res){
    if(err) return console.log(err);

    console.log(res);
});

// without callback:
pagedownloader.download("https://www.google.com/", '<html><img src="images/srpr/logo3w.png" /></html>',  __dirname + '/google2');

FAQs

Package last updated on 07 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc