# cordova-plugin-cipherlab-barcode-reader

> Barcode Reader Cordova Plugin for CipherLab Android Mobile Devices

Latest version **1.0.2** (published 2021-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-cipherlab-barcode-reader
pnpm add cordova-plugin-cipherlab-barcode-reader
yarn add cordova-plugin-cipherlab-barcode-reader
bun add cordova-plugin-cipherlab-barcode-reader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-03-18 |
| First published | 2021-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 285.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CIPHERLAB SW |
| Maintainers | cipherlab-sw |
| Keywords | barcode, scanner, reader, ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-cipherlab-barcode-reader
- npm.io page: https://npm.io/package/cordova-plugin-cipherlab-barcode-reader

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-03-18
- 1.0.1 — 2021-03-17
- 1.0.0 — 2021-03-12
- 0.0.2 — 2021-03-11
- 0.0.1 — 2021-03-11

## README

# cordova-plugin-cipherlab-barcode-reader
Barcode Reader Cordova Plugin for CipherLab Android Mobile Devices

## How to use
### Install
```bash
cordova plugin add cordova-plugin-cipherlab-barcode-reader
```

For Ionic:

```bash
ionic cordova plugin add cordova-plugin-cipherlab-barcode-reader
```

### Vanilla JS (Cordova)
Set barcode scan listener in onDeviceReady callback.

When barcode scanned event triggered, you can get decoded barcode data, symbology and code type in listener callback argument.
```js
function onDeviceReady() {
    cordova.plugins.CipherLabBarcodeReader.setBarcodeScannedListener((data) => {
        document.getElementById('barcode').innerHTML = data.barcode;
        document.getElementById('symbology').innerHTML = data.symbology;
        document.getElementById('codeType').innerHTML = data.codeType;
    }, (error) => {
        console.log(error);
    });
}
```

You can also clear barcode scan listener if needed. You can set the listener again with the code above.
```js
document.getElementById('clearBarcodeScannedListener').addEventListener('click', function(){
    cordova.plugins.CipherLabBarcodeReader.clearBarcodeScannedListener();
});
```

### Angular (Ionic)
Set barcode scan listener in component's lifecycle hook.

Similarly, define your callback method for clearing scan listener if needed.
```ts
// declare cordova
declare let cordova: any;

// set scan listener
ngAfterViewInit() {
    cordova.plugins.CipherLabBarcodeReader.setBarcodeScannedListener((data) => {
        this.barcode = data.barcode;
        this.symbology = data.symbology;
        this.codeType = data.codeType;
        this.changeDetector.detectChanges();   
    }, (error) => {
        console.log(error);
    });
}

// clear barcode scan listener
onClearBarcodeListenerClicked() {
    cordova.plugins.CipherLabBarcodeReader.clearBarcodeScannedListener();
}
```

## Links
For more detail about CipherLab Android Devices, please visit [CipherLab Official Website](https://www.cipherlab.com/)

---
_Source: https://npm.io/package/cordova-plugin-cipherlab-barcode-reader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
