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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hipolitodev/ocr-bo

v1.1.12

Published

## Install

Downloads

16

Readme

OCR and BO

Install

npm install @hipolitodev/ocr-bo

OCR Cloud

Usage

Creating a new instance

const ocr = new OCR(url);

Where

  • url is the url of the endpoint of the OCR service.

Analyze image

const result = ocr.analyzeImage(type, imageFront, imageBack);

Where

  • type it is the number id corresponding to the document to be analyze.
  • imageFront front image of the document in jpg or png format, with maximum weight of 3MB.
  • imageBack back image of the document in jpg or png format, with maximum weight of 3MB.

Document types:

|Type|Document| |--|--| |100|DUI| |200|NIT| |300|LICENCIA| |400|PASAPORTE| |500|CARNET DE RESIDENCIA|

Response Schema

The success response for a request contains the following information.

  • http code: 200.
  • code: response code.
  • success: always returns true when the code is 200.
  • fields: returns an array with the document fields.
  • raw data: collects all the data from the OCR made to the images recopila la data completa de todo el OCR realizado a las imágenes.

Response Examples

DUI
{
	"code": 200,
	"success": true,
	"fields": {
		"uid": "0123456-7",
		"name": {
			"names": "Jane Judy",
			"lastnames": "Doe Roe",
			"name": [
				"Jane",
				"Judy",
				""
			],
			"lastname": [
				"Doe",
				""
			],
			"marriedsurname": "Roe"
		},
		"gender": "F",
		"birthPlace": "San Salvador, San Salvador",
		"birthDate": "01/01/1981”,
		"expeditionDate": “01/01/2018”,
		"expirationDate": “01/01/2026”,
		"zoneCode": "123450000",
		"address": "1A CALLE OTE #1-8 APTO # 3",
		"city": "El Carmen",
		"state": "La Union",
		"status": "Casado(a)",
		"spouseName": "John James Doe Roe",
		"profession": "Estudiante"
	}
}
NIT
{
	"code": 200,
	"success": true,
	"fields": {
		“uid”: ”0123-456789-012-3”,
		“name”: ”John Doe”,
		“nrc”: ”0123-4”,
		“dui”: "01234567-8",
		"expeditionDate": “16/10/2018”
	}
}
Licencia
{
	"code": 200,
	"success": true,
	"fields": {
		“uid”: ”0123-456789-012-3”,
		“name”: ”John Doe”,
		“dui”: "01234567-8",
		"expeditionDate": “16/10/2018”
		“birthDate”: "01/01/1991”,
		“expirationDate”: ”10/2025”,
	}
}
Pasaporte
{
	"code": 200,
	"success": true,
	"fields": {
		“uid”: “A01234567”,
		“countryCode”: ”SVL”,
		“name1”: ”John James”,
		“name2”: ”Doe Roe”,
		“birthDate”: ”01/01/1991”,
		“expirationDate”: ”06/10/2025”,
		“gender”: ”M”,
	}
}

Errors

|Error code|Type|Message| |--|--|--| |422|Unprocessable Entity|The image was not received correctly| |422|Unprocessable Entity|The limit of 3MB per image has been exceeded.| |422|Unprocessable Entity|The type value is not valid.| |422|Unprocessable Entity|The image is not jpg or png format.| |422|Unprocessable Entity|The request is unacceptable, due to the lack of a required parameter.| |401|Unauthorized|A valid API KEY was not provided.| |402|Request Failed|The parameters are valid but the request failed.| |403|Forbidden|The API KEY does not have permissions to make the request.| |500, 502, 503, 504|Server Errors|Something went wrong in the infrastructure or software.|

Biometric Onboarding Cloud

Usage

Creating a new instance

const bo = new BO(url);

Where

  • url is the url of the endpoint of the BO service.

Create new

const result = bo.new(selfies);

Where

  • selfies the number of selfies that you want to use in the onboarding process, this value must be between 2 and 6.

Response Schema

The success response for a request contains the following information.

  • http code: 200.
  • code: response code.
  • success: always returns true when the code is 200.
  • uuid: is the unique ID of the started onboarding process.
  • selfies: returns an array with the identifiers of selfies to request.
Dictionary of possible selfies:

|type|document| |--|--| |front-normal|Frontal selfie| |front-smile|Frontal selfie smiling| |left-normal|selfie looking left| |left-smile|Selfie looking left smiling| |right-normal|selfie looking right| |right-smile|Selfie looking to the right smiling| |up-normal|Selfie looking slightly up| |up-smile|Selfie looking slightly up smiling|

Response Example

{
    "code": 200,
    "success": true,
    “uuid”: "67b2e5e5-0fc5-41a7-94a3-ad96e1f89bbe",
    "selfies": [
	    “front-normal”,
	    “front-smile”,
	    “left-normal”,
	    “right-smile”,
	    “up-normal”
    ]
}

Errors

|Error code|Type|Message| |--|--|--| |422|Unprocessable Entity|The value of the selfies parameter is not in the correct range.| |422|Unprocessable Entity|The request is unacceptable, due to the lack of a required parameter.| |401|Unauthorized|A valid API KEY was not provided.| |402|Request Failed|The parameters are valid but the request failed.| |403|Forbidden|The API KEY does not have permissions to make the request.| |500, 502, 503, 504|Server Errors|Something went wrong in the infrastructure or software.|

Verify

const result = bo.verify({ uuid, document, selfies });

Where

  • uuid text
  • document text
  • selfies text

Response Schema

The success response for a request contains the following information.

  • http code: 200.
  • code: response code.
  • success: always returns true when the code is 200.
  • uuid: is the unique ID of the started onboarding process.
  • accuracy: value between 0.00 and 1 that shows the accuracy between the selfies and the document
  • verified: returns true when the accuracy is greater than 60%

Response Example

{
	"code": 200,
	"success": true,
	“uuid”: "67b2e5e5-0fc5-41a7-94a3-ad96e1f89bbe",
	“accuracy”: 0.85,
	“verified”: true
}

Errors

|Error code|Type|Message| |--|--|--| |422|Unprocessable Entity|The uid is not valid.| |422|Unprocessable Entity|The identity document was not sent.| |422|Unprocessable Entity|The selfies sent do not match the ones assigned to the uid.| |422|Unprocessable Entity|The limit of 3MB per image has been exceeded.| |422|Unprocessable Entity|The image is not jpg or png format.| |422|Unprocessable Entity|The request is unacceptable, due to the lack of a required parameter.| |401|Unauthorized|A valid API KEY was not provided.| |402|Request Failed|The parameters are valid but the request failed.| |403|Forbidden|The API KEY does not have permissions to make the request.| |500, 502, 503, 504|Server Errors|Something went wrong in the infrastructure or software.|

License

License