Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mindee

Package Overview
Dependencies
Maintainers
6
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mindee

Mindee Client Library for Node.js

  • 3.7.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

License: MIT GitHub Workflow Status NPM Version Downloads

Mindee API Helper Library for Node.js

Quickly and easily connect to Mindee's API services using Node.js.

Quick Start

Here's the TL;DR of getting started.

First, get an API Key

Then, install this library:

npm install mindee

Finally, Node.js away!

Loading a File and Parsing It

Global Documents
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);
Region-Specific Documents
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);
Custom Documents (API Builder)
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" });

Handling the Return

// 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());
});

Further Reading

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.

License

Copyright © Mindee

Available as open source under the terms of the MIT License.

Keywords

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc