@@ -13,39 +13,43 @@ npm install mindee
1313
1414Finally, Node.js away!
1515
16- ### Off-the-Shelf Document
16+ ### Off-the-Shelf Documents
1717
18- ``` ts
19- import { Client , InvoiceResponse } from " mindee" ;
18+ ``` js
19+ const mindee = require (" mindee" );
20+ // for TS or modules:
21+ // import * as mindee from "mindee";
2022
2123// Init a new client
22- const mindeeClient = new Client ({apiKey: " my-api-key" });
24+ const mindeeClient = new mindee. Client ({apiKey: " my-api-key" });
2325
2426// Load a file from disk and parse it
2527const invoiceResponse = mindeeClient .docFromPath (" /path/to/the/invoice.pdf" )
26- .parse (InvoiceResponse );
28+ .parse (mindee . InvoiceResponse );
2729
2830// Print a brief summary of the parsed data
2931invoiceResponse .then ((resp ) => {
30- console .log (resp .document );
32+ console .log (resp .document );
3133});
3234```
3335
34- ### Custom Document (API Builder)
36+ ### Custom Documents (API Builder)
3537
36- ``` ts
37- import { Client , CustomResponse } from " mindee" ;
38+ ``` js
39+ const mindee = require (" mindee" );
40+ // for TS or modules:
41+ // import * as mindee from "mindee";
3842
3943// Init a new client and add your document endpoint
40- const mindeeClient = new Client ({apiKey: " my-api-key" })
44+ const mindeeClient = new mindee. Client ({apiKey: " my-api-key" })
4145 .addEndpoint ({
4246 accountName: " john" ,
4347 documentType: " wsnine" ,
4448});
4549
4650// Load a file from disk and parse it
4751const customResponse = mindeeClient .docFromPath (" /path/to/the/wsnine.jpg" )
48- .parse (CustomResponse , {docType: " wsnine" });
52+ .parse (mindee . CustomResponse , {docType: " wsnine" });
4953
5054// Print a brief summary of the parsed data
5155customResponse .then ((resp ) => {
0 commit comments