Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DavideViolante/ocr-space-api-wrapper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2b74db0e7bb3efbfbd57fc2048489a6ffb8c6599
Choose a base ref
...
head repository: DavideViolante/ocr-space-api-wrapper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe65eb8fa89d71a6ec257bf0753c61260b14dda8
Choose a head ref

Commits on Oct 26, 2021

  1. Breaking change: import lib using destructuring

    Add tests and coverage using mocha and nyc
    Rename data to formData
    Update readme
    DavideViolante committed Oct 26, 2021
    Copy the full SHA
    c41fd1e View commit details
  2. Copy the full SHA
    843aa02 View commit details
  3. Copy the full SHA
    37fe9c7 View commit details
  4. Copy the full SHA
    e9f48fe View commit details
  5. Copy the full SHA
    ad800e2 View commit details
  6. Copy the full SHA
    02074e4 View commit details
  7. Copy the full SHA
    f44e77d View commit details

Commits on Nov 1, 2021

  1. Bump axios from 0.23.0 to 0.24.0

    Bumps [axios](https://github.com/axios/axios) from 0.23.0 to 0.24.0.
    - [Release notes](https://github.com/axios/axios/releases)
    - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
    - [Commits](axios/axios@v0.23.0...v0.24.0)
    
    ---
    updated-dependencies:
    - dependency-name: axios
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Nov 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4e97c44 View commit details
  2. Bump eslint from 8.0.1 to 8.1.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.0.1 to 8.1.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.0.1...v8.1.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Nov 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    75cd3b8 View commit details

Commits on Nov 2, 2021

  1. Merge pull request #33 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.1.0
    
    Bump eslint from 8.0.1 to 8.1.0
    DavideViolante authored Nov 2, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    209834a View commit details
  2. Merge pull request #32 from DavideViolante/dependabot/npm_and_yarn/ax…

    …ios-0.24.0
    
    Bump axios from 0.23.0 to 0.24.0
    DavideViolante authored Nov 2, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fe75780 View commit details

Commits on Dec 1, 2021

  1. Bump eslint from 8.1.0 to 8.3.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.1.0 to 8.3.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.1.0...v8.3.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    80c145e View commit details
  2. Merge pull request #34 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.3.0
    
    Bump eslint from 8.1.0 to 8.3.0
    DavideViolante authored Dec 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d47fce2 View commit details

Commits on Dec 17, 2021

  1. Copy the full SHA
    dff1a43 View commit details
  2. Add TS typings

    DavideViolante committed Dec 17, 2021
    Copy the full SHA
    da5b93b View commit details
  3. Copy the full SHA
    6ff08d5 View commit details
  4. Update deps

    DavideViolante committed Dec 17, 2021
    Copy the full SHA
    165d020 View commit details

Commits on Jan 1, 2022

  1. Bump eslint from 8.4.1 to 8.6.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.4.1 to 8.6.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.4.1...v8.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e70059c View commit details

Commits on Jan 2, 2022

  1. Merge pull request #35 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.6.0
    
    Bump eslint from 8.4.1 to 8.6.0
    DavideViolante authored Jan 2, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df350a6 View commit details

Commits on Feb 1, 2022

  1. Bump axios from 0.24.0 to 0.25.0

    Bumps [axios](https://github.com/axios/axios) from 0.24.0 to 0.25.0.
    - [Release notes](https://github.com/axios/axios/releases)
    - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
    - [Commits](axios/axios@v0.24.0...v0.25.0)
    
    ---
    updated-dependencies:
    - dependency-name: axios
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fdab794 View commit details
  2. Bump mocha from 9.1.3 to 9.2.0

    Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.3 to 9.2.0.
    - [Release notes](https://github.com/mochajs/mocha/releases)
    - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
    - [Commits](mochajs/mocha@v9.1.3...v9.2.0)
    
    ---
    updated-dependencies:
    - dependency-name: mocha
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    265a037 View commit details
  3. Bump eslint from 8.6.0 to 8.8.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.8.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.6.0...v8.8.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bdd88e9 View commit details
  4. Merge pull request #36 from DavideViolante/dependabot/npm_and_yarn/ax…

    …ios-0.25.0
    
    Bump axios from 0.24.0 to 0.25.0
    DavideViolante authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cf2ee8f View commit details
  5. Merge pull request #38 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.8.0
    
    Bump eslint from 8.6.0 to 8.8.0
    DavideViolante authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f5e517c View commit details
  6. Merge pull request #37 from DavideViolante/dependabot/npm_and_yarn/mo…

    …cha-9.2.0
    
    Bump mocha from 9.1.3 to 9.2.0
    DavideViolante authored Feb 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2cccfeb View commit details

Commits on Feb 15, 2022

  1. Bump follow-redirects from 1.14.7 to 1.14.8

    Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
    - [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
    - [Commits](follow-redirects/follow-redirects@v1.14.7...v1.14.8)
    
    ---
    updated-dependencies:
    - dependency-name: follow-redirects
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 15, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9b4fc29 View commit details
  2. Merge pull request #39 from DavideViolante/dependabot/npm_and_yarn/fo…

    …llow-redirects-1.14.8
    
    Bump follow-redirects from 1.14.7 to 1.14.8
    DavideViolante authored Feb 15, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    26d2950 View commit details

Commits on Mar 1, 2022

  1. Bump mocha from 9.2.0 to 9.2.1

    Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.0 to 9.2.1.
    - [Release notes](https://github.com/mochajs/mocha/releases)
    - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
    - [Commits](mochajs/mocha@v9.2.0...v9.2.1)
    
    ---
    updated-dependencies:
    - dependency-name: mocha
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bee2c65 View commit details
  2. Bump eslint from 8.8.0 to 8.10.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.8.0 to 8.10.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.8.0...v8.10.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    00fbb06 View commit details
  3. Bump axios from 0.25.0 to 0.26.0

    Bumps [axios](https://github.com/axios/axios) from 0.25.0 to 0.26.0.
    - [Release notes](https://github.com/axios/axios/releases)
    - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
    - [Commits](axios/axios@v0.25.0...v0.26.0)
    
    ---
    updated-dependencies:
    - dependency-name: axios
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7cf29d3 View commit details
  4. Merge pull request #42 from DavideViolante/dependabot/npm_and_yarn/ax…

    …ios-0.26.0
    
    Bump axios from 0.25.0 to 0.26.0
    DavideViolante authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5a6c851 View commit details
  5. Merge pull request #41 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.10.0
    
    Bump eslint from 8.8.0 to 8.10.0
    DavideViolante authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3844e3d View commit details
  6. Merge pull request #40 from DavideViolante/dependabot/npm_and_yarn/mo…

    …cha-9.2.1
    
    Bump mocha from 9.2.0 to 9.2.1
    DavideViolante authored Mar 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b5c9048 View commit details

Commits on Mar 28, 2022

  1. Bump minimist from 1.2.5 to 1.2.6

    Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
    - [Release notes](https://github.com/substack/minimist/releases)
    - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)
    
    ---
    updated-dependencies:
    - dependency-name: minimist
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 28, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    19136f1 View commit details
  2. Merge pull request #43 from DavideViolante/dependabot/npm_and_yarn/mi…

    …nimist-1.2.6
    
    Bump minimist from 1.2.5 to 1.2.6
    DavideViolante authored Mar 28, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f41ec96 View commit details
  3. Update deps

    DavideViolante committed Mar 28, 2022
    Copy the full SHA
    a634964 View commit details

Commits on May 1, 2022

  1. Bump axios from 0.26.1 to 0.27.2

    Bumps [axios](https://github.com/axios/axios) from 0.26.1 to 0.27.2.
    - [Release notes](https://github.com/axios/axios/releases)
    - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
    - [Commits](axios/axios@v0.26.1...v0.27.2)
    
    ---
    updated-dependencies:
    - dependency-name: axios
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f50dec8 View commit details
  2. Bump eslint from 8.12.0 to 8.14.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.12.0 to 8.14.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.12.0...v8.14.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4728278 View commit details

Commits on May 2, 2022

  1. Merge pull request #45 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.14.0
    
    Bump eslint from 8.12.0 to 8.14.0
    DavideViolante authored May 2, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    61c7419 View commit details
  2. Merge pull request #44 from DavideViolante/dependabot/npm_and_yarn/ax…

    …ios-0.27.2
    
    Bump axios from 0.26.1 to 0.27.2
    DavideViolante authored May 2, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cc5456f View commit details

Commits on Jun 1, 2022

  1. Bump mocha from 9.2.2 to 10.0.0

    Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.2 to 10.0.0.
    - [Release notes](https://github.com/mochajs/mocha/releases)
    - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
    - [Commits](mochajs/mocha@v9.2.2...v10.0.0)
    
    ---
    updated-dependencies:
    - dependency-name: mocha
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jun 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb458e1 View commit details
  2. Merge pull request #47 from DavideViolante/dependabot/npm_and_yarn/mo…

    …cha-10.0.0
    
    Bump mocha from 9.2.2 to 10.0.0
    DavideViolante authored Jun 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d425e21 View commit details
  3. Bump eslint from 8.14.0 to 8.16.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.14.0 to 8.16.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.14.0...v8.16.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jun 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    05108ff View commit details
  4. Merge pull request #46 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.16.0
    
    Bump eslint from 8.14.0 to 8.16.0
    DavideViolante authored Jun 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1bcebe5 View commit details

Commits on Jul 1, 2022

  1. Bump eslint from 8.16.0 to 8.18.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.16.0 to 8.18.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.16.0...v8.18.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jul 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    689bb42 View commit details
  2. Merge pull request #48 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.18.0
    
    Bump eslint from 8.16.0 to 8.18.0
    DavideViolante authored Jul 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7f59f4 View commit details

Commits on Aug 1, 2022

  1. Bump eslint from 8.18.0 to 8.20.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.20.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.18.0...v8.20.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Aug 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b560d85 View commit details

Commits on Aug 2, 2022

  1. Merge pull request #49 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.20.0
    
    Bump eslint from 8.18.0 to 8.20.0
    DavideViolante authored Aug 2, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a38e0aa View commit details

Commits on Sep 1, 2022

  1. Bump eslint from 8.20.0 to 8.23.0

    Bumps [eslint](https://github.com/eslint/eslint) from 8.20.0 to 8.23.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.20.0...v8.23.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7f044fc View commit details
  2. Merge pull request #50 from DavideViolante/dependabot/npm_and_yarn/es…

    …lint-8.23.0
    
    Bump eslint from 8.20.0 to 8.23.0
    DavideViolante authored Sep 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8a924db View commit details
Showing with 5,085 additions and 177 deletions.
  1. +4 −3 .eslintrc.json
  2. +20 −0 .github/workflows/ci.yml
  3. +23 −0 .github/workflows/coverage.yml
  4. +18 −0 .github/workflows/npmpublish.yml
  5. +13 −7 README.md
  6. +3 −0 index.d.ts
  7. +18 −18 index.js
  8. +4,909 −142 package-lock.json
  9. +13 −7 package.json
  10. BIN test/eng.png
  11. +64 −0 test/test.js
7 changes: 4 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -2,15 +2,16 @@
"env": {
"commonjs": true,
"es2021": true,
"node": true
"node": true,
"mocha": true
},
"extends": "google",
"extends": ["eslint:recommended", "google"],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"max-len": [
"error", 100
"error", 120
],
"object-curly-spacing": [
"error", "always"
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm test
23 changes: 23 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Coveralls

on: ["push", "pull_request"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'

- name: Coverage
run: |
npm ci
npm run coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Package to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OCR.Space Node.js API wrapper
![npm](https://img.shields.io/npm/dm/ocr-space-api-wrapper) [![Donate](https://img.shields.io/badge/paypal-donate-179BD7.svg)](https://www.paypal.me/dviolante)
[![](https://github.com/davideviolante/ocr-space-api-wrapper/workflows/Node.js%20CI/badge.svg)](https://github.com/DavideViolante/ocr-space-api-wrapper/actions?query=workflow%3A"Node.js+CI") [![Coverage Status](https://coveralls.io/repos/github/DavideViolante/ocr-space-api-wrapper/badge.svg?branch=master)](https://coveralls.io/github/DavideViolante/ocr-space-api-wrapper?branch=master) ![npm](https://img.shields.io/npm/dm/ocr-space-api-wrapper) [![Donate](https://img.shields.io/badge/paypal-donate-179BD7.svg)](https://www.paypal.me/dviolante)

[![NPM](https://nodei.co/npm/ocr-space-api-wrapper.png)](https://nodei.co/npm/ocr-space-api-wrapper/)

@@ -10,20 +10,20 @@ Node.js wrapper for [ocr.space APIs](https://ocr.space/ocrapi), a service for ex

## Usage
```js
const ocrSpace = require('ocr-space-api-wrapper');
const { ocrSpace } = require('ocr-space-api-wrapper');

async function main () {
try {
// Using the OCR.space default free token + remote file
// Using the OCR.space default free API key (max 10reqs in 10mins) + remote file
const res1 = await ocrSpace('http://dl.a9t9.com/ocrbenchmark/eng.png');

// Using your personal token + local file
// Using your personal API key + local file
const res2 = await ocrSpace('/path/to/file.pdf', { apiKey: '<API_KEY_HERE>' });

// Using your personal token + base64 image + custom language
// Using your personal API key + base64 image + custom language
const res3 = await ocrSpace('data:image/png;base64...', { apiKey: '<API_KEY_HERE>', language: 'ita' });
} catch (error) {
console.log(error);
console.error(error);
}
}
```
@@ -37,13 +37,19 @@ The input param specifies the input file (see examples above). It can be _one_ o

### `options` object
This param is an object with the following keys:
- `apiKey`: your API key for [ocr.space APIs](https://ocr.space/ocrapi).
- `apiKey`: your API key for [ocr.space APIs](https://ocr.space/ocrapi). Default API key has a limit of max 10reqs in 10mins.
- `ocrUrl`: a different URL for ocr.space APIs, for example when you purchase the PRO plan.
- All other params as documented in the [official website](https://ocr.space/OCRAPI#PostParameters).

## Response
This package does not change the response in any way, please refer to the [official website](https://ocr.space/OCRAPI#Response).

## Run lint
`npm run lint`

## Run tests
`npm test`

## Bug or feedback
Please open a new issue.

3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "ocr-space-api-wrapper" {
export function ocrSpace(input: string, options?: any): any;
}
36 changes: 18 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ function detectInput(input) {
* Call OCR Space APIs
* @param {string} input Input file as url, file path or base64 image (required)
* @param {object} options Options
* @return {object} OCR results
*/
async function ocrSpace(input, options = {}) {
try {
@@ -28,45 +29,44 @@ async function ocrSpace(input, options = {}) {
filetype, detectOrientation, isCreateSearchablePdf,
isSearchablePdfHideTextLayer, scale, isTable, OCREngine,
} = options;
const data = new FormData();
const formData = new FormData();
const detectedInput = detectInput(input);
switch (detectedInput) {
case 'file':
data.append('file', fs.createReadStream(input));
formData.append('file', fs.createReadStream(input));
break;
case 'url':
case 'base64Image':
data.append(detectedInput, input);
formData.append(detectedInput, input);
break;
}
data.append('language', String(language || 'eng'));
data.append('isOverlayRequired', String(isOverlayRequired || 'false'));
formData.append('language', String(language || 'eng'));
formData.append('isOverlayRequired', String(isOverlayRequired || 'false'));
if (filetype) {
data.append('filetype', String(filetype));
formData.append('filetype', String(filetype));
}
data.append('detectOrientation', String(detectOrientation || 'false'));
data.append('isCreateSearchablePdf', String(isCreateSearchablePdf || 'false'));
data.append('isSearchablePdfHideTextLayer', String(isSearchablePdfHideTextLayer || 'false'));
data.append('scale', String(scale || 'false'));
data.append('isTable', String(isTable || 'false'));
data.append('OCREngine', String(OCREngine || '1'));
formData.append('detectOrientation', String(detectOrientation || 'false'));
formData.append('isCreateSearchablePdf', String(isCreateSearchablePdf || 'false'));
formData.append('isSearchablePdfHideTextLayer', String(isSearchablePdfHideTextLayer || 'false'));
formData.append('scale', String(scale || 'false'));
formData.append('isTable', String(isTable || 'false'));
formData.append('OCREngine', String(OCREngine || '1'));
const request = {
method: 'POST',
url: String(ocrUrl || 'https://api.ocr.space/parse/image'),
headers: {
apikey: String(apiKey || 'helloworld'),
...data.getHeaders(),
...formData.getHeaders(),
},
data,
data: formData,
maxContentLength: Infinity,
maxBodyLength: Infinity,
};
const response = await axios(request);
// console.log(response.data)
return response.data;
const { data } = await axios(request);
return data;
} catch (error) {
console.error(error);
}
}

module.exports = ocrSpace;
exports.ocrSpace = ocrSpace;
5,051 changes: 4,909 additions & 142 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "ocr-space-api-wrapper",
"version": "1.0.7",
"version": "2.1.3",
"description": "Node.js wrapper for ocr.space APIs.",
"main": "index.js",
"scripts": {
"start": "node index",
"lint": "eslint ./"
"start": "node index.js",
"lint": "eslint ./",
"test": "nyc mocha --timeout 60000 --bail",
"coverage": "nyc --reporter=lcov --reporter=text mocha --timeout 60000 --bail"
},
"repository": {
"type": "git",
@@ -18,7 +20,9 @@
"ocr api",
"wrapper",
"nodejs",
"optical character recognition"
"optical character recognition",
"pdf",
"image"
],
"author": "Davide Violante",
"license": "MIT",
@@ -27,11 +31,13 @@
},
"homepage": "https://github.com/DavideViolante/ocr-space-api-wrapper#readme",
"dependencies": {
"axios": "^0.23.0",
"axios": "^1.1.3",
"form-data": "^4.0.0"
},
"devDependencies": {
"eslint": "^8.0.1",
"eslint-config-google": "^0.14.0"
"eslint": "^8.12.0",
"eslint-config-google": "^0.14.0",
"mocha": "^10.0.0",
"nyc": "^15.1.0"
}
}
Binary file added test/eng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions test/test.js

Large diffs are not rendered by default.