Hi! Thanks for maintaining pdf-parse.
We use pdf-parse in a Node service that runs in Docker. We only call getText() for text extraction, never render to images. But @napi-rs/canvas is a hard dependency, which adds ~48MB of native binaries to our container.
Would you consider making @napi-rs/canvas an optional/peer dependency? Text extraction would work without it; rendering APIs would throw a clear error if it's not installed.
Quick options:
optionalDependencies + runtime check in render code paths
peerDependenciesMeta.optional: true
- Split exports — e.g.
pdf-parse/text (no canvas) vs pdf-parse (full)
Happy to send a PR if you're open to any of these — let me know which direction you'd prefer.
Either way, thanks for the library!
Hi! Thanks for maintaining pdf-parse.
We use pdf-parse in a Node service that runs in Docker. We only call
getText()for text extraction, never render to images. But@napi-rs/canvasis a hard dependency, which adds ~48MB of native binaries to our container.Would you consider making
@napi-rs/canvasan optional/peer dependency? Text extraction would work without it; rendering APIs would throw a clear error if it's not installed.Quick options:
optionalDependencies+ runtime check in render code pathspeerDependenciesMeta.optional: truepdf-parse/text(no canvas) vspdf-parse(full)Happy to send a PR if you're open to any of these — let me know which direction you'd prefer.
Either way, thanks for the library!