Skip to content

LeXuanKhanh/rn-qr-barcode-image-scan

rn-qr-barcode-image-scan

react native library for scanning qrcode/barcode from image

Installation

npm install rn-qr-barcode-image-scan

or

yarn add rn-qr-barcode-image-scan

Usage

import { scanFromPath } from 'rn-qr-barcode-image-scan';
import {
  launchImageLibrary,
  type ImageLibraryOptions,
} from 'react-native-image-picker';

// ...

const option: ImageLibraryOptions = {
  mediaType: 'photo',
};
const result = await launchImageLibrary(option);
const uri = result?.assets?.[0]?.uri;
if (!uri) {
  return;
}
//codes: string[]
const codes = await scanFromPath(uri);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published