New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-qr-code-scanner

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-qr-code-scanner - npm Package Compare versions

Comparing version 1.0.3 to 1.5.0

5

package.json
{
"name": "react-simple-qr-code-scanner",
"version": "1.0.3",
"version": "1.5.0",
"description": "A super simple qr code scanner",

@@ -8,3 +8,4 @@ "main": "index.js",

"clean": "rm -rf dist",
"build": "yarn clean && tsc && cp package.json README.md ./dist"
"build": "yarn clean && tsc && cp package.json README.md ./dist",
"publishToNpm": "npm publish ./dist"
},

@@ -11,0 +12,0 @@ "repository": {

/// <reference types="react" />
import { Exception, Result } from "@zxing/library";
declare type props = {
result?: (result: Result) => void;
errors?: (error: Exception) => void;
onResult: (result: Result) => void;
Errors?: (error: Exception) => void;
facingMode?: "enviroment" | "user";
};
export declare const QrCodeScanner: (props: props) => JSX.Element;
export {};

10

QrCodeScanner.js

@@ -13,9 +13,9 @@ import { BrowserMultiFormatReader } from "@zxing/library";

video: {
facingMode: "enviroment",
facingMode: props.facingMode || "enviroment",
},
}, videoRef.current, (result, error) => {
if (result && props.result != null)
props.result(result);
if (error && props.errors != null)
props.errors(error);
if (result)
props.onResult(result);
if (error && props.Errors != null)
props.Errors(error);
});

@@ -22,0 +22,0 @@ return () => {

# A simple qr-code scanner for react
This is a simple qr-code scanner component for react
## Installing
A step by step series guide to setup this component.
Start a node project
npm init
Install the library with composer
npm i react-simple-qr-code-scanner
### Demo
```tsx
import { QrCodeScanner } from "react-simple-qr-code-scanner";
function App() {
return (
<QrCodeScanner
onResult={(result) => {
console.log(result);
}}
Errors={(error) => {
//console.log(error);
}},
facingMode={"enviroment"} //or user
/>
);
}
```
## License
This project is licensed under the [MIT](LICENSE)
License - see the [LICENSE](LICENSE) file for
details
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc