diff --git a/PDFMergerBase.js b/PDFMergerBase.js index 9df364b..87dfe4f 100644 --- a/PDFMergerBase.js +++ b/PDFMergerBase.js @@ -163,7 +163,7 @@ export default class PDFMergerBase { // see https://developer.mozilla.org/en-US/docs/Web/API/URL if (input instanceof URL) { if (typeof fetch === 'undefined') { - throw new Error('fetch is not defined. You need to use a polyfill for this to work in Node.js.') + throw new Error('fetch is not defined. You need to use a polyfill for this to work.') } const res = await fetch(input) const aBuffer = await res.arrayBuffer() diff --git a/README.md b/README.md index 07bb98a..eae3e8a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ This node.js library can **merge multiple PDF documents**, or parts of them, to ## Legacy notes -* 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. +* 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. * 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. This library is inspired by the [PHP library PDFMerger](https://github.com/myokyawhtun/PDFMerger) and has a very similar API. @@ -14,7 +13,7 @@ This library is inspired by the [PHP library PDFMerger](https://github.com/myoky `npm install --save pdf-merger-js` -of global installation if you want to use the cli tool: +or global installation if you just want to use the cli tool: `npm install -g pdf-merger-js` @@ -22,7 +21,7 @@ of global installation if you want to use the cli tool: ### CLI -``` +```txt Options: -V, --version output the version number -o, --output Merged PDF output file path diff --git a/test/PDFMerger.test.js b/test/PDFMerger.test.js index ccb7262..fa6cd4f 100644 --- a/test/PDFMerger.test.js +++ b/test/PDFMerger.test.js @@ -124,10 +124,10 @@ describe('PDFMerger', () => { const testIfFetch = typeof fetch !== 'undefined' ? test : test.skip testIfFetch('provide input as URL', async () => { const merger = new PDFMerger() - const TestfileAURL = new URL('https://raw.githubusercontent.com/nbesli/pdf-merger-js/master/test/fixtures/Testfile_A.pdf') + const TestfileAURL = new URL('https://github.com/nbesli/pdf-merger-js/raw/master/test/fixtures/Testfile_A.pdf') expect(TestfileAURL).toBeInstanceOf(URL) await merger.add(TestfileAURL) - const TestfileBURL = new URL('https://raw.githubusercontent.com/nbesli/pdf-merger-js/master/test/fixtures/Testfile_B.pdf') + const TestfileBURL = new URL('https://github.com/nbesli/pdf-merger-js/raw/master/test/fixtures/Testfile_B.pdf') expect(TestfileBURL).toBeInstanceOf(URL) await merger.add(TestfileBURL) const diff = await pdfDiff(