awesome-qr-code-generator
v1.0.8
Published
QR code generator
Downloads
45
Readme
awesome-qr-code-generator
Simple QR code generator. Output Svg & Png
Installation
For install npm package inside your project folder do:
npm install --save awesome-qr-code-generator
ES6/ES7
awesome-qr-code-generator
can be used in browser through module bundlers like Browserify and Webpack
import { toDataURL, toSvgString } from 'awesome-qr-code-generator';
const svgString = toSvgString(text);
const pngBase64 = toDataURL(text);
API
toSvgString(text, [options])
toDataURL(text, [options])
text
Type: String|Array
Text to encode or a list of objects describing segments.
options
Optional
QR Code options
margin
Type: Number
Default: 1
Define how much wide the quiet zone should be.
scale
Type: Number
Default: 20
Scale factor. A value of 1
means 1px per modules (black dots). Affects only the quality of PNG
codeColor
Type: String
Default: #000000ff
Color of qr code. Value must be in hex format (RGBA).
backgroundColor
Type: String
Default: #ffffffff
Background Color. Value must be in hex format (RGBA).