# pagedownloader

> Node module to download a complete html webpage

Latest version **0.0.3** (published 2014-02-07) · 0 weekly downloads

## Install

```sh
npm install pagedownloader
pnpm add pagedownloader
yarn add pagedownloader
bun add pagedownloader
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-02-07 |
| First published | 2013-02-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Sam Decrock |
| Maintainers | samdecrock |

## Links

- npm: https://www.npmjs.com/package/pagedownloader
- Repository: https://github.com/SamDecrock/node-download-complete-page
- Issues: https://github.com/SamDecrock/node-download-complete-page/issues
- npm.io page: https://npm.io/package/pagedownloader

## Dependencies (3)

- [step](https://npm.io/package/step.md) 0.0.5
- [async](https://npm.io/package/async.md) ~0.2.5
- [httpreq](https://npm.io/package/httpreq.md) *

## Recent versions

- 0.0.3 (latest) — 2014-02-07
- 0.0.2 — 2014-02-06
- 0.0.1 — 2013-02-12

## README

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__

```js
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__

```js
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');
```

---
_Source: https://npm.io/package/pagedownloader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
