modesty / pdf2json

converts binary PDF to JSON and text, for server-side PDF processing and command-line use.
https://github.com/modesty/pdf2json
Other
2.02k stars 377 forks source link

build: output to both es module and commJS, PDFParser to be named export #338

Closed modesty closed 6 months ago

modesty commented 6 months ago

address build issue by bundle and output to both es module and commonJS #161 #222 #330. Updates,

  1. PDFParser is no longer the default export, import statement needs to be updated with curly bracket as documented in readme.md
  2. npm run build is required for command line, output folder is 'dist/`, sourcemap of the bundle are also there
  3. Previous root level pdfparser.cjs is moved to dist/ together with pdfparser.js, the package default module mode is still es module
  4. lib/p2jcmd.js and lib/p2jcmdarg.js, plus test/index.cjs are updated to import from /dist instead of lib or nother non-bundled source
  5. npm test is re-written with jest, vows is removed. Currently it covers ~12 pdf forms, it will be extended to cover more pdf forms
  6. no functionality changes, this change is to enable correct import and load in different runtime environment