Skip to content

Commit 585f3b3

Browse files
committed
chore: remove no longer needed node-fetch
test: test urls fetching only if fetch is available chore: code clean-up test: test urls fetching only if fetch is available
1 parent 07b55af commit 585f3b3

7 files changed

+18
-7661
lines changed

PDFMergerBase.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default class PDFMergerBase {
163163
// see https://developer.mozilla.org/en-US/docs/Web/API/URL
164164
if (input instanceof URL) {
165165
if (typeof fetch === 'undefined') {
166-
throw new Error('fetch is not defined. You need to use a polyfill for this to work in Node.js.')
166+
throw new Error('fetch is not defined. You need to use a polyfill for this to work.')
167167
}
168168
const res = await fetch(input)
169169
const aBuffer = await res.arrayBuffer()

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ This node.js library can **merge multiple PDF documents**, or parts of them, to
44

55
## Legacy notes
66

7-
* If you are searching for the legacy version based on
8-
[pdfjs](https://www.npmjs.com/package/pdfjs) please install a [v3 release](https://github.com/nbesli/pdf-merger-js/releases?q=v3&expanded=true). Since [v4](https://github.com/nbesli/pdf-merger-js/releases?q=v4&expanded=true) we use [pdf-lib](https://pdf-lib.js.org/) instead.
7+
* If you are searching for the legacy version based on [pdfjs](https://www.npmjs.com/package/pdfjs) please install a [v3 release](https://github.com/nbesli/pdf-merger-js/releases?q=v3&expanded=true). Since [v4](https://github.com/nbesli/pdf-merger-js/releases?q=v4&expanded=true) we use [pdf-lib](https://pdf-lib.js.org/) instead.
98
* If you are searching for a legacy version using CommonJS modules please install a [v4 release](https://github.com/nbesli/pdf-merger-js/releases?q=v4&expanded=true). Since [v5](https://github.com/nbesli/pdf-merger-js/releases?q=v5&expanded=true) we use the modern ESM ("import") instead of the CommonJS ("require) module standard.
109

1110
This library is inspired by the [PHP library PDFMerger](https://github.com/myokyawhtun/PDFMerger) and has a very similar API.
@@ -14,15 +13,15 @@ This library is inspired by the [PHP library PDFMerger](https://github.com/myoky
1413

1514
`npm install --save pdf-merger-js`
1615

17-
of global installation if you want to use the cli tool:
16+
or global installation if you just want to use the cli tool:
1817

1918
`npm install -g pdf-merger-js`
2019

2120
## Usage
2221

2322
### CLI
2423

25-
```
24+
```txt
2625
Options:
2726
-V, --version output the version number
2827
-o, --output <outputFile> Merged PDF output file path

0 commit comments

Comments
 (0)