1.0.4 • Published 6 years ago

fetch-pdf-callback v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

download-pdf

Install

npm install fetch-pdf-callback --save

Usage

const download = require('fetch-pdf-callback')

let pdf = 'http://apps.who.int/iris/bitstream/10665/137592/1/roadmapsitrep_7Nov2014_eng.pdf'

let options = {
	directory: './pdf/downloads/',
	filename: '2018-07-24.pdf'
}

download(pdf, options, (err) => {
	if (err) {
		console.log('Error ', err)
	}

	console.log('Download success')
})

API

download(url, options, callback(err))

  • url string of the file URL to download

  • options object with options

    • directory string with path to directory where to save files (default: current working directory)
    • filename string for the name of the file to be saved as (default: filename in the url)
    • timeout integer of how long in ms to wait while downloading (default: 20000)
  • callback function to run after

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago