Package Exports
- @sylvainneung/qr-code-generator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sylvainneung/qr-code-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
QR-code-generator
Simply generate your QR codes
Required
- npm >= 6.4.1
- node > 7.6 (async / await support required)
Dependencies
Get started
$ npm i @sylvainneung/qr-code-generator --saveExample
'use strict';
const qrGenerator = require('@sylvainneung/qr-code-generator');
//default directory root of your project
//Sync qrGenerator.generateQrImage("mydata", "mypicname", "png");
//Async qrGenerator .generateQrImageAsync("myOtherData", "otherpic", "svg") .then(response => { console.log("Data", response) }) .catch(err => console.log("Err => ", err));
Documentation
| Methods | params | description |
|---|---|---|
| generateQrImageAsync | data, picName, picType | Create new QR image asynchronous |
| generateQrImage | data, picName, picType | Create new QR image synchronous |
Details params
| Params | Type | description | Infos |
|---|---|---|---|
| data | String | your data ( please check | Numeric only Max. 7,089 characters (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) / Alphanumeric Max. 4,296 characters (0–9, A–Z [upper-case only], space, $, %, *, +, -, ., /, :) / Binary/byte Max. 2,953 characters (8-bit bytes) (23624 bits) |
| picName | String | name of your file | |
| picType | String -> only support "svg" "png" "jpeg" "jpg" |
Create new QR image synchronous |