feat(initial): add comprehensive PDF to JPEG preview library with dual-environment support

- Add Node.js implementation using @push.rocks/smartpdf
- Add browser implementation with PDF.js and Web Workers
- Support configurable quality, dimensions, and page selection
- Include comprehensive TypeScript definitions and error handling
- Provide extensive test coverage for both environments
- Add download functionality and browser compatibility checking
This commit is contained in:
2025-08-03 21:44:01 +00:00
commit bc1c7edd35
23 changed files with 12822 additions and 0 deletions

54
package.json Normal file
View File

@@ -0,0 +1,54 @@
{
"name": "@push.rocks/smartpreview",
"version": "1.0.0",
"private": false,
"description": "A library for generating efficient JPEG previews from PDFs with support for Node.js and browser environments",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"exports": {
".": "./dist_ts/index.js",
"./web": "./dist_ts_web/index.js"
},
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild tsfolders --allowimplicitany)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartpreview.git"
},
"keywords": [
"pdf",
"preview",
"jpeg",
"image",
"conversion",
"nodejs",
"browser",
"pdfjs",
"worker"
],
"author": "Lossless GmbH",
"license": "MIT",
"dependencies": {
"@push.rocks/smartpdf": "^4.0.0",
"@push.rocks/smartenv": "^5.0.5",
"@push.rocks/smartjson": "^5.0.10",
"@push.rocks/smartpromise": "^4.0.3"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.70",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.81",
"@types/node": "^20.6.3"
},
"engines": {
"node": ">=16"
},
"browserslist": [
"last 1 Chrome version"
],
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
}