npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@finos/fin-ocr-sdk

v1.0.5

Published

Optical Character Recognition SDK

Readme

FINOS - Incubating Contributors-Invited

FIN OCR SDK

This package is a browser and mobile-friendly SDK which provides typescript programmatic APIs to perform OCR (Optical Character Recognition).

NOTE: This SDK is now available on npm. If you'd like to build and test local changes to the SDK, you'll find instructions in our developer guide.

The initial use case supports OCR of bank checks in order to return the routing, account, and check number fields; however, it is designed to support other use cases in the future.

Getting Started

Sample code

The following is a sample code snippet demonstrating how to use this SDK to OCR a bank check.

import * as ocr from "@finos/fin-ocr-sdk";
import * as fs from 'fs';

// Scan a check image contained in 'file' of TIFF format
async function scanCheck(file: string) {
    // Initialize the check manager, allowing
    // configuration via environment variables.
    const checkMgr = await ocr.CheckMgr.getInstanceByEnv(process.env);
    // Read from a file and scan the image.
    // This is called once per check.
    const b64 = fs.readFileSync(file).toString("base64");
    const result = await checkMgr.scan({
        id: "1",
        image: {
            format: "tiff",
            buffer: b64
        }
    });
    console.log(JSON.stringify(result,null,4));
    // When done scanning all checks, stop the check manager
    await checkMgr.stop();
}
How to configure

The following environment variables may be used to configure the SDK.

| Name | Default | Description | | ---- | ------- | ----------- | | OCR_LOG_LEVEL | "info" | The log level which is any of the following: "fatal", "error", "warn", "info", "debug", "trace", or "verbose". | | OCR_SLOW_REQUEST_MS | 0 | If greater than 0, enable slow request detection. If a request takes longer than this many milliseconds, a warning message is logged at level OCR_SLOW_OR_HUNG_REQUEST_LOG_LEVEL when the request completes. | | OCR_HUNG_REQUEST_MS | 0 | If greater than 0, enable hung request detection. If a request takes longer than this many milliseconds, a warning message is logged at level OCR_SLOW_OR_HUNG_REQUEST_LOG_LEVEL, even if the request has not completed. | | OCR_SLOW_OR_HUNG_REQUEST_LOG_LEVEL | "debug" | The log level for slow or hung requests. The value may be any of the following: "fatal", "error", "warn", "info", "debug", "trace", or "verbose". | | OCR_OVERLAP_CORRECTION | true | Set to false to disable OCR overlap correction. |

The src/config.ts file contains a complete list of configuration variables. Each variable is configuable programatically or via an environment variable.

Design

This SDK is designed to be browser and mobile friendly.

It uses the following open source projects:

  • opencv.js to perform various image pre-processing operations such as locating special symbols on an image, cropping and cleaning an image, etc;

  • tesseract.js to translate text on a (preferably clean) image.

License

Copyright 2024 Capital One

Distributed under the Apache License, Version 2.0.

SPDX-License-Identifier: Apache-2.0

Links