百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

Javascript-Barcode-Reader

> 编程语言
开源

简单而快的条形码解码器,支持代码128,代码93,代码39,标准/工业 5,标准/工业 2, Interleaved 2 of 5, Codabar, EAN-13, EAN- 8 在java的条形码

197 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

简单而快的条形码解码器,支持代码128,代码93,代码39,标准/工业 5,标准/工业 2, Interleaved 2 of 5, Codabar, EAN-13, EAN- 8 在java的条形码

Javascript-Barcode-Reader

Simple & Fast Barcode decoder for Browsers and Node.js capable of reading multiple barcode formats including Code128 (UCC/EAN-128), Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8, UPC-A, UPC-E, MSI, and Pharmacode.

Try now

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

Available decoders

  • EAN-13
  • EAN-8
  • UPC-A
  • UPC-E
  • Code-39
  • Code-93
  • Code-2of5
    • standard
    • Interleaved
  • Codabar
  • Code-128 (UCC/EAN-128)
  • MSI
  • Pharmacode

Features

  • Pure JavaScript/TypeScript implementation
  • Works in both Node.js and browser environments
  • Supports multiple barcode formats
  • Adaptive thresholding for challenging images
  • Single-pass mode for faster decoding
  • Automatic barcode region detection
  • Automatic rotation detection and correction
  • TypeScript support

Installation

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

bash
npm i javascript-barcode-reader

or use cdn:

xml

or download manually:

javascript-barcode-reader

Usage

Node.js

…

Browser

javascriptBarcodeReader will be available as global in Browsers.

javascript
javascriptBarcodeReader({
  /* Image ID || HTML5 Image || HTML5 Canvas || HTML5 Canvas ImageData || Image URL */
  image: source,
  barcode: 'code-2of5',
  // barcodeType: 'industrial', // for code-2of5: 'industrial' or 'interleaved'
  options: {
    // useAdaptiveThreshold: true // for images with shaded/ gradient portions
    // singlePass: true
    // detectRotation: true // auto-detect and correct rotation
    // locateBarcode: true // auto-locate barcode region
  },
})
  .then((code) => {
    console.log(code)
  })
  .catch((err) => {
    console.log(err)
  })

Supported Barcode Types

Barcode Type Value
EAN-13 'ean-13'
EAN-8 'ean-8'
UPC-A 'upc-a'
UPC-E 'upc-e'
Code-39 'code-39'
Code-93 'code-93'
Code-2of5 'code-2of5'
Codabar 'codabar'
Code-128 'code-128'
MSI 'msi'
Pharmacode 'pharmacode'

Options

  • useAdaptiveThreshold: Apply adaptive thresholding for images with shading or gradients
  • singlePass: Use single-pass decoding for faster processing
  • detectRotation: Automatically detect and correct barcode rotation
  • locateBarcode: Automatically locate barcode region in image

Note

  • For best results, ensure barcode is relatively straight in the image
  • Works best when barcode occupies most of the image

Contributing

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

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptbarcodehacktoberfestjavascriptnode

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言