• Stars
    star
    180
  • Rank 213,097 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple and Fast Barcode decoder with support of Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8 barcodes in javascript.

Javascript-Barcode-Reader

Simple & Fast Barcode decoder for Browsers and Node.js capapable of reading Code128 (UCC/EAN-128), Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar and EAN-13 barcodes.

Build Status codebeat badge codecov All Contributors Rate on Openbase

NPM

Try now

https://codesandbox.io/s/javascript-barcode-reader-liium

Available decoders

  • EAN-13
  • EAN-8
  • Code-39
  • Code-93
  • Code-2of5
    • standard
    • Interleaved
  • Codabar
  • Code-128 (UCC/EAN-128)

How to use

Install

Recommended way to install is by using package manager (npm, yarn etc):

npm i javascript-barcode-reader

or use cdn:

<script src="//unpkg.com/javascript-barcode-reader"></script>

or download manually:

javascript-barcode-reader

Node.js

import javascriptBarcodeReader from 'javascript-barcode-reader'

javascriptBarcodeReader({
  /* Image file Path || {data: Uint8ClampedArray, width, height} || HTML5 Canvas ImageData */
  image: source,
  barcode: 'code-2of5',
  // barcodeType: 'industrial',
  options: {    
    // useAdaptiveThreshold: true // for images with shaded/ gradient portions
    // singlePass: true
  }
})
  .then(code => {
    console.log(code)
  })
  .catch(err => {
    console.log(err)
  })

Browser

javascriptBarcodeReader will be available as global in Browsers.

javascriptBarcodeReader({
  /* Image ID || HTML5 Image || HTML5 Canvas || HTML5 Canvas ImageData || Image URL */
  image: source,
  barcode: 'code-2of5',
  // barcodeType: 'industrial',
  options: {
    // useAdaptiveThreshold: true // for images with shaded/ gradient portions
    // singlePass: true
  }
})
  .then(code => {
    console.log(code)
  })
  .catch(err => {
    console.log(err)
  })

Note

  • This script does not implement logic to locate/rotate barcode in the given image.
  • Make sure the barcode image is the only thing in the image. Otherwise this script will most probably fail.

Contributing

  • Each decoder is defined in src directory as a module.
  • Tests are defined in the tests directory using Jest.

Contributors

Thanks goes to these wonderful people (emoji key):

Cristian Nitescu
Cristian Nitescu

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

vue-electron-template

An Electron & Vue.js template with Hot-reloading enabled and common Vue plugins, dev, debug and build scripts configured.
JavaScript
317
star
2

vue-chrome-extension-boilerplate

Boilerplate for Chrome extension using Vue.js and Webpack with auto-reload enabled.
JavaScript
252
star
3

bulma-fluent

Fluent Design Theme for Bulma, inspired by Microsoft’s Fluent Design System. https://mubaidr.github.io/bulma-fluent/
Vue
118
star
4

vue-fluent

Vuejs 2+ components built using Microsoft’s Fluent Design System based on Buefy.
Vue
77
star
5

node-vue-template

A starter template for building complete application using Node.js and Vue.js with some included packages and configurations to help start the development quickly.
JavaScript
73
star
6

vite-vue3-chrome-extension-v3

Another vite powered web extension (chrome, firefox, etc.) starter template.
TypeScript
71
star
7

vue-swimlane

A Text Swimlane plugin for Vue.js
Vue
71
star
8

SPA-asp.net-api-vuejs-

A Vue.js single page application for basic Management By Objective tasks using ASP .NET Webapi 2 and SQL server
JavaScript
61
star
9

bulma-addons

Addons for Bulma CSS framework
Sass
50
star
10

vuejs-extension-pack

Popular VS Code extensions for Vue.js development.
34
star
11

vite-vue3-chrome-extension-template

vite-vue3-chrome-extension template
TypeScript
31
star
12

vue2-migration-helper

Transforms Vue.js 2.0 SFCs to Vue.js 3.0 Composition API syntax.
TypeScript
30
star
13

Book-Trading-Club

A sample application using node.js api and vuejs
Vue
20
star
14

prerender-plugin

A Node.js/ webpack plugin to prerender static HTML in a single-page application.
JavaScript
15
star
15

bulma-pro

A professional theme for Bulma! https://mubaidr.github.io/bulma-pro/
Vue
14
star
16

Photoshop-script-to-slice-PSD

Save all layers to PNG in their respective bounding box size
JavaScript
8
star
17

Tab-Manager-opera

Easy Tab manager for Opera 15+/Chome
JavaScript
8
star
18

selection-popup

Perform customizable actions (Search, Copy etc) on selected text.
JavaScript
8
star
19

SlimScrollBar

Modern looks for Webkit/Blink based browsers.
CSS
5
star
20

mubaidr

My Readme :)
4
star
21

activity-automation

Manage daily activities and get reports on timely basis.
JavaScript
4
star
22

Better-Speeddial

Improvements for Opera Speed-dial
CSS
3
star
23

Github-Dark-Easy

Modified Github theme for VS Code, easy on the eyes
2
star
24

reloadImage

Reload images in Tab/Window using context menu.
JavaScript
2
star
25

mubaidr.github.io

Vue
2
star
26

vuelidate-summary

A tiny-tiny helper function to display summaries in vuelidate (https://github.com/monterail/vuelidate) using vue.js (https://vuejs.org/)
JavaScript
2
star
27

vite-chrome-extension

A simplest possible vite based chrome extension starter
HTML
2
star
28

BrainIDE

Brain.js IDE
JavaScript
1
star
29

puppeteer-template

A template to quickly start website automation using puppeteer
JavaScript
1
star
30

ip-changer-python

Quick cmd IP changer
Python
1
star
31

TweetRight

Simple Chrome Extension for Twitter.com
CSS
1
star
32

feedback.js.org

Gather in-app user feedback and contact requests with screen-shot, browser information and more.
TypeScript
1
star
33

ors-node-archived

An application with nodejs API and Vuejs frontend
JavaScript
1
star
34

electron-starter-template

An Electron boilerplate with Hot-reloading enabled and common plugins, dev and build scripts configured.
JavaScript
1
star
35

Bulma-Personal-Template

A template for Personal/portfolio website using Bulma css framework.
HTML
1
star
36

Auto-Reload-Close-tabs-Extension

Provides ability to auto-reload or auto-close tabs after specific time (Chromium + Opera).
JavaScript
1
star
37

vuejs-simon-game

A simple simon game using vuejs (an exercise from freecode camp)
1
star