afpp 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,2 +1,59 @@
|
|
|
1
1
|
# afpp
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Another f*cking pdf parser. (alpha)
|
|
4
|
+
|
|
5
|
+
## todo
|
|
6
|
+
|
|
7
|
+
- [x] pdf2string
|
|
8
|
+
- [ ] pdf2img
|
|
9
|
+
|
|
10
|
+
## Why?
|
|
11
|
+
|
|
12
|
+
If you are parsing pdf files in nodejs and you are satisfied with your actual solution, good for you, you don't need this.
|
|
13
|
+
|
|
14
|
+
But if you’ve encountered one or more of these issues:
|
|
15
|
+
|
|
16
|
+
- package size (+30mb)
|
|
17
|
+
- blocking event loop
|
|
18
|
+
- performance issues
|
|
19
|
+
- buggy as shit
|
|
20
|
+
- not working in esm/commonjs
|
|
21
|
+
- old pdfjs-dist as peer dependency
|
|
22
|
+
|
|
23
|
+
then you might find this package useful.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
- Node.js 18+
|
|
28
|
+
|
|
29
|
+
## Getting started
|
|
30
|
+
|
|
31
|
+
`npm install afpp`
|
|
32
|
+
|
|
33
|
+
**commonjs**:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
const { pdf2string } = require("afpp");
|
|
37
|
+
const path = require("node:path");
|
|
38
|
+
|
|
39
|
+
const pathToFile = path.join("example.pdf");
|
|
40
|
+
|
|
41
|
+
(async function start() {
|
|
42
|
+
const pdfString = await pdf2string(pathToFile);
|
|
43
|
+
console.log(pdfString);
|
|
44
|
+
})();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**esm**:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { pdf2string } from "afpp";
|
|
51
|
+
import path from "node:path";
|
|
52
|
+
|
|
53
|
+
const pathToFile = path.join("example.pdf");
|
|
54
|
+
|
|
55
|
+
(async function start() {
|
|
56
|
+
const pdfString = await pdf2string(pathToFile);
|
|
57
|
+
console.log(pdfString);
|
|
58
|
+
})();
|
|
59
|
+
```
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAY5C,MAAM,kBAAkB,GAAG,KAAK,EAAE,UAAkB,EAAE,EAAE;IACtD,MAAM,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;YACvC,IAAI,EAAE,IAAI,UAAU,CAAC,UAAU,CAAC;SACjC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC;QAE9C,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;QACjC,MAAM,YAAY,GAAa,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,YAAY,GAAmC,EAAE,CAAC;QAExD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YACxD,YAAY,CAAC,IAAI,CACf,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;gBAC/C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;oBAC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version": "1.0.0",
|
|
4
4
|
"description": "another f*cking pdf parser",
|
|
5
5
|
"types": "./dist/types/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/l2ysho/afpp/issues"
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/l2ysho/afpp#readme",
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"pdfjs-dist": "4.6.82"
|
|
38
|
-
},
|
|
39
36
|
"devDependencies": {
|
|
40
37
|
"@types/node": "22.5.5",
|
|
41
38
|
"semantic-release": "24.1.1",
|
|
42
39
|
"tsx": "4.19.1",
|
|
43
40
|
"typescript": "5.6.2"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"pdfjs-dist": "4.6.82"
|
|
44
44
|
}
|
|
45
45
|
}
|