2.0.4 • Published 6 years ago

barcode-scan-listener v2.0.4

Weekly downloads
27
License
MIT
Repository
github
Last release
6 years ago

Barcode Scan Listener

Listen for barcode scan events in the browser.

Usage

npm i barcode-scan-listener --save
import barcodeScanListener from 'barcode-scan-listener';

const removeScanListener = barcodeScanListener.onScan({
  barcodePrefix: 'L%',
  barcodeValueTest: /^123$/,
  finishScanOnMatch: true,
  scanDuration: 500
}, function (barcode) {
  console.log(barcode);
});

// Now, scanning a barcode 'L%123abc' will log '123'

removeScanListener()

Contributing

This module is written in ES2015 and converted to node-friendly CommonJS via Babel.

To compile the src directory to build:

npm run build

Deploying a new version

npm version [major|minor|patch]
npm run build
npm publish build # publish the build directory instead of the main directory
git push --follow-tags # update github
2.0.4

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago