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

scribe.js-ocr

v0.2.6

Published

High-quality OCR and text extraction for images and PDFs.

Downloads

713

Readme

Scribe.js

Scribe.js is a JavaScript library that performs OCR and extracts text from images and PDFs.

Common use cases:

  1. Recognize text from images.
  2. Extract text from user-uploaded .pdf files.
    1. If the .pdf file is already text-native, scribe.js can extract the existing text.
    2. If the .pdf file is image-native, scribe.js can recognize text using OCR.
  3. Write .pdf files that include a high-quality invisible text layer.
    1. scribe.js can insert text into an existing .pdf file, making it searchable.

Scribe.js is a library intended for developers. End users who want to scan documents should see the officially-supported GUI at scribeocr.com (repo here).

Setup

Install from npm by running the following:

npm i scribe.js-ocr

Scribe.js is written in JavaScript using ESM, so can be imported directly from browser or Node.js JavaScript code without a build step.

// Import statement in browser:
import scribe from 'node_modules/scribe.js-ocr/scribe.js';
// Import statement for Node.js:
import scribe from 'scribe.js-ocr';

// Basic usage
scribe.extractText(['https://tesseract.projectnaptha.com/img/eng_bw.png'])
	.then((res) => console.log(res))

When using Scribe.js in the browser, all files must be served from the same origin as the file importing Scribe.js. This means that importing Scribe.js from a CDN will not work. There is no UMD version.

Templates

The following are template repos showing how Scribe.js can be used within various frameworks/build systems.

  • Browser with ESM (no build): https://github.com/scribeocr/scribe.js-example-esm-browser
  • Browser with Webpack 5: https://github.com/scribeocr/scribe.js-example-webpack5
  • Browser with Vue.js v2: https://github.com/scribeocr/scribe.js-example-vue2

Contributions are appreciated--if you are using Scribe.js within a framework not listed below, consider making a basic repo and adding to this list with a PR, especially if non-obvious steps were required.

Scribe.js vs. Tesseract.js

Considering whether Scribe.js or Tesseract.js is better for your project? Read this article.

Documentation

Projects and Examples

The following are examples and projects built using Scribe.js. Additional examples can be found in the examples directory.

If you have a project or example repo that uses Scribe.js, feel free to add it to this list using a pull request. Examples submitted should be well documented such that new users can run them; projects should be functional and actively maintained.

Contributing

To work on a local copy, simply clone with --recurse-submodules and install. Please run the automated tests before making a PR.

## Clone the repo, including recursively cloning submodules
git clone --recurse-submodules [email protected]:scribeocr/scribe.js.git
cd scribe.js

## Install dependencies
npm i

## Make changes
## [...]

## Run automated tests before making PR
npm run test