![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
mindee
Advanced tools
Changelog
v1.0.7 (2021-11-25)
Readme
Download and decompress or clone the source code from github and then do in your node project :
npm install mindee
You can use the SDK easily by creating a Client like this :
const { Client } = require("mindee");
const mindeeClient = new Client({
invoiceToken: "invoiceApiToken",
receiptToken: "receiptExpenseApiToken",
});
mindeeClient.invoice.parse({ input: "path/to/file", inputType: "file" });
mindeeClient.receipt.parse({ input: base64String, inputType: "base64" });
mindeeClient.financialDocument.parse({
input: base64String,
inputType: "base64",
});
Three apis are actually supported : invoice (ìnvoice
), receipt (receipt
) and financial document (financialDocument
)
You can find more examples on how to use the SDK into the folder examples
The mindee Client can take multiple parameters to be initialize. Some this parameters can also be set with env variables. If the env variable and the parameter are both set, the parameter will be the one chosen by the client. This is a list of them:
MINDEE_INVOICE_TOKEN
) The expense api tokenMINDEE_RECEIPT_TOKEN
) The invoice api tokentrue
by default) If true
, the SDK will throw on errorMINDEE_DEBUG
, false
by default) If true
, logging will be in debug modeDepending on what type of document you want to parse, you need to add specifics auth token for each endpoint. We suggest storing your credentials as environment variables for security reasons.
const { Client } = require("mindee");
const fs = require("fs");
// Invoice token can be set by Env (MINDEE_INVOICE_TOKEN) or via params (Client({invoiceToken: "token"}))
const mindeeClient = new Client();
// parsing invoice from pdf
mindeeClient.invoice
.parse({ input: "./documents/invoices/invoice.pdf" }) // see examples for more input types
.then((res) => {
console.log("Success !");
console.log(res.invoices);
console.log(res.invoice);
})
.catch((err) => {
console.error(err);
});
const { Client } = require("mindee");
const fs = require("fs");
// Receipt token can be set by Env (MINDEE_RECEIPT_TOKEN) or via params (Client({receiptToken: "token"}))
const mindeeClient = new Client();
// parsing receipt from picture
mindeeClient.receipt
.parse({ input: "./documents/receipts/receipt.jpg" }) // see examples for more input types
.then((res) => {
console.log("Success !");
console.log(res.receipts);
console.log(res.receipt);
})
.catch((err) => {
console.error(err);
});
The Financial document API optimizes the parsing results when you don't know if your file is a receipt or an invoice.
const { Client } = require("mindee");
// Invoice token and Receipt token must be set
// Receipt token can be set by Env (MINDEE_RECEIPT_TOKEN) or via params (Client({receiptToken: "token"}))
// Invoice token can be set by Env (MINDEE_INVOICE_TOKEN) or via params (Client({invoiceToken: "token"}))
const mindeeClient = new Client();
// parsing receipt from picture
mindeeClient.financialDocument
.parse({ input: "./documents/receipts/receipt.jpg" })
.then((res) => {
console.log("Success !");
console.log(res.financialDocuments);
console.log(res.financialDocument);
})
.catch((err) => {
console.error(err);
});
First, link your package to the test repository by linking the node package to the tests :
cd mindee-api-nodejs/
npm link
cd tests/
npm link mindee
To run the tests, use the command npm run test
A basic documentation of the sdk has been done with the help of JSDoc.
If you want to generate it, you can use the command npm run documentation
.
A folder docs
will be created with generated documentation.
Open the index.html
in your browser to read the documentation.
FAQs
Mindee Client Library for Node.js
The npm package mindee receives a total of 6,021 weekly downloads. As such, mindee popularity was classified as popular.
We found that mindee demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.