1.0.1 • Published 2 years ago

pdf-crawler v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pdf-crawler

A simple Node.js version pdf download crawler

https://www.npmjs.com/package/pdf-crawler

https://github.com/xgqfrms/pdf-crawler

Install

$ npm i pdf-crawler
# OR
$ yarn add app-node-env

Usage

CommonJS Module (✅)

const { downloadPDF } = require('pdf-crawler');

const fs = require("fs");
const path = require("path");

const folder = path.resolve(__dirname, '../pdf');

if (!fs.existsSync(folder)) {
  fs.mkdirSync(folder);
}

const url = 'https://javascript.xgqfrms.xyz/pdfs/TypeScript%20Language%20Specification.pdf';
const filename = 'TypeScript-v1.8.pdf';

downloadPDF(url, `${folder}/${filename}`,);

ESM Module (🚧)

import { downloadPDF } from "pdf-crawler";

const fs = require("fs");
const path = require("path");

const folder = path.resolve(__dirname, '../pdf');

if (!fs.existsSync(folder)) {
  fs.mkdirSync(folder);
}

const url = 'https://javascript.xgqfrms.xyz/pdfs/TypeScript%20Language%20Specification.pdf';
const filename = 'TypeScript-v1.8.pdf';

downloadPDF(url, `${folder}/${filename}`,);