website-scraper-existing-directory
Version:
Plugin for website-scraper which allows saving resources to the existing directory
38 lines (30 loc) • 3.45 kB
Markdown
[](https://www.npmjs.org/package/website-scraper-existing-directory)
[](https://www.npmjs.org/package/website-scraper-existing-directory)
[](https://github.com/website-scraper/website-scraper-existing-directory)
[](https://coveralls.io/github/website-scraper/website-scraper-existing-directory?branch=master)
[](https://qlty.sh/gh/website-scraper/projects/website-scraper-existing-directory)
[](https://qlty.sh/gh/website-scraper/projects/website-scraper-existing-directory)
# website-scraper-existing-directory
Plugin for [website-scraper](https://github.com/website-scraper/node-website-scraper) which allows to save resources to existing directory.
Please keep in mind that saving to existing directory may overwrite your files. Be careful with it!
## Sponsors
Maintenance of this project is made possible by all the [contributors](https://github.com/website-scraper/website-scraper-existing-directory/graphs/contributors) and [sponsors](https://github.com/sponsors/s0ph1e).
If you'd like to sponsor this project and have your avatar or company logo appear below [click here](https://github.com/sponsors/s0ph1e). 💖
<!-- sponsors --><a href="https://github.com/aivus"><img src="https://github.com/aivus.png" width="60px" alt="User avatar: Illia Antypenko" /></a><a href="https://github.com/swissspidy"><img src="https://github.com/swissspidy.png" width="60px" alt="User avatar: Pascal Birchler" /></a><a href="https://github.com/itscarlosrufo"><img src="https://github.com/itscarlosrufo.png" width="60px" alt="User avatar: Carlos Rufo" /></a><a href="https://github.com/francescamarano"><img src="https://github.com/francescamarano.png" width="60px" alt="User avatar: Francesca Marano" /></a><a href="https://github.com/github"><img src="https://github.com/github.png" width="60px" alt="User avatar: GitHub" /></a><a href="https://github.com/Belrestro"><img src="https://github.com/Belrestro.png" width="60px" alt="User avatar: Andrew Vorobiov" /></a><a href="https://github.com/Effiezhu"><img src="https://github.com/Effiezhu.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/slicemedia"><img src="https://github.com/slicemedia.png" width="60px" alt="User avatar: " /></a><!-- sponsors -->
## Requirements
* nodejs version: >= 20
* website-scraper version: 6.*
## Installation
```sh
npm install website-scraper website-scraper-existing-directory
```
## Usage
```javascript
import scrape from 'website-scraper';
import SaveToExistingDirectoryPlugin from 'website-scraper-existing-directory';
await scrape({
urls: ['http://example.com'],
directory: '/path/to/save',
plugins: [ new SaveToExistingDirectoryPlugin() ]
});
```