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

cordova-plugin-ocr

v1.0.0

Published

cordova plugin for mobile ocr text recognition using google ml kit

Readme

|Introduction | Supported_Platforms | Installation_Steps |

cordova-plugin-ocr

This plugin was made possible because of Google's ML Kit SDK, as it is a dependency of this plugin. The supported languages are listed here. This plugin is absolutely free and will work offline once install is complete. All required files required for Text Recognition are downloaded during install if necessary space is available.

This plugin defines a global ocrtext object, which provides an method that accepts base64 inputs. If some text was detected in the image, this text will be returned in an object. The imageuri or base64 can be send to the plugin using any another plugin like cordova-plugin-camera. Although the object is attached to the global scoped window, it is not available until after the deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(ocrtext);
}

Supported Platforms

  • Android
  • iOS

Installation Steps

This requires cordova 12.0.0+ , cordova android 6.4.0+ and cordova ios 4.3.0+

cordova plugin add cordova-plugin-ocr

Note : This might take a while!

Optional installation variable for Android MLKIT_TEXT_RECOGNITION_VERSION Version of com.google.android.gms:play-services-mlkit-text-recognition. This defaults to 16.1.0 but by using this variable you can specify a different version if you like:

cordova plugin add cordova-plugin-ocr --variable MLKIT_TEXT_RECOGNITION_VERSION=16.1.0

Also add the following plugin :-

  • cordova plugin add cordova-plugin-camera

Firebase Setup :- This version of the plugin only uses the on-device functionality and no longer requires Firebase.

Plugin Usage

ocrtext.getText(onSuccess, onFail, imgdata);

  • ocrtext.getText The ocrtext.getText function accepts image data as uri or base64 and uses google mobile vision to recognize text and return the recognized text as string on its successcallback.

  • imgdata BASE64 encoded image .

  • successCallback The return value is sent to the successCallback callback function, in string format if no errors occured.

  • errorCallback The errorCallback function returns Scan Failed: Found no text to scan if no text was detected on the image. It also return other messages based on the error conditions.

Note :- After install the OCR App using this plugin does not need an internet connection for Optical Character Recognition since all the required data is downloaded locally on install.