
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Quickly and easily connect to Mindee's API services using Node.js.
Here's the TL;DR of getting started.
First, get an API Key
Then, install this library:
npm install mindee
Finally, Node.js away!
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";
// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
// Load a file from disk and parse it
const apiResponse = mindeeClient
.docFromPath("/path/to/the/file.ext")
.parse(mindee.InvoiceV4);
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";
// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
// Load a file from disk and parse it
const apiResponse = mindeeClient
.docFromPath("/path/to/the/file.ext")
.parse(mindee.fr.IdCardV1);
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";
// Init a new client and add your document endpoint
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" })
.addEndpoint({
accountName: "john",
endpointName: "wsnine",
});
// Load a file from disk and parse it
const apiResponse = mindeeClient
.docFromPath("/path/to/the/file.ext")
.parse(mindee.CustomV1, { endpointName: "wsnine" });
// Handle the response Promise
apiResponse.then((resp) => {
// The `document` property can be undefined:
// * TypeScript will not compile without this guard clause
// (or consider using the '?' notation)
// * JavaScript will be very happy to produce subtle bugs
// without this guard clause
if (resp.document === undefined) return;
// full object
console.log(resp.document);
// string summary
console.log(resp.document.toString());
});
There's more to it than that for those that need more features, or want to customize the experience.
All the juicy details are described in the Official Guide.
Copyright © Mindee
Available as open source under the terms of the MIT License.
v3.6.0 - 2023-02-01
The FinancialDocumentV1
class now uses an actual API call to the new route financial_document
.
Previously, determining whether a document is an invoice or a receipt was done internally by this library.
The API call way is much better, however some fields have been renamed compared to the internal handling.
This was done so field names now match exactly Invoice
and Receipt
classes.
As such, we encourage users to migrate to the new field structure.
If this is problematic, it's possible to use the deprecated way.
Simply pass FinancialDocumentV0
to the parse
method.
Usage is otherwise identical.
FAQs
Mindee Client Library for Node.js
The npm package mindee receives a total of 7,216 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 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.