0.8.2 • Published 7 years ago

pdf-bulk-downloader v0.8.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Goal

This is a library which downloads multiple PDF files from a site when they have the same url pattern with a one-by-one incremented number. The library replaces manual one-by-one downloading of the files with one simple API call.

Usage of the API

PDFs to download:

Expected results (locally downloaded files in your out directory):

  • text01.pdf
  • text02.pdf
  • ...
  • text12.pdf

How to call it:

var downloader = require('pdf-bulk-downloader')

const urlPattern = 'https://any.host/pdfs/text[n].pdf'
const from = 1
const to = 12

downloader.start(urlPattern, from, to)
  • configure urlPattern, from, to
  • keep [n] as is: it is a placeholder recognized by the application, which is replaced by the numbers from from to to incremented by 1.

Installation

npm install pdf-bulk-downloader --save-dev

Examples

See a typical usage in download-pdfs.js:

$ git clone https://github.com/labudao/pdf-bulk-downloader.git --depth 1
$ cd pdf-bulk-downloader
$ npm install
$ npm run test