node-red-contrib-qrcode-generator
v0.4.0
Published
QRCODE Generator
Downloads
454
Maintainers
Readme
node-red-contrib-qrcode-generator
Create QRCode from action text. Based on node-qrcode module.
Install
Install from PALETTE Manager or run the following command in your NODE-RED user directory typically: ~/.node-red
npm install node-red-contrib-qrcode-generator
Usage
Processes string to generate QRCode. Use the editor as an helper to forge action text string (link, sms, wifi etc.) or post your custom string using msg.qrcodeinput
input property. Here is documentation to create your custom action text. Remember QRCode are specific for some devices for example Wi-Fi Network config works only on Android or iOS 11+. There are a lot of different standards on actionable text, the helper (editor configuration) aims to cover some of the most used. Finally node returns DataUri format image in msg.payload
.
You can render DataUri result, in html page with img element, using template node with mustache:
<body>
<img src="{{payload}}">
</body>
or you can link output to image viewer node and get a preview in your Node-Red workspace panel.
You can use different colors but keep in mind that Background Color must be brighter than QRcode Color.
Input
msg.qrcodeinput
Custom string, it will be used instead of editor configuration. e.g.:
msg.qrcodeinput = 'mailto:[email protected]';
creates QRcode with action text for sending email to a specific address.
Output
msg.payload
Image in DataURI format.