Add Github repo url as dependency
{
"dependencies": {
"qrcode": "git+https://github.com/tokenkit/qrcode.git"
}
}
And
npm install
import qrcode from 'qrcode'
qrcode.encode(document.getElementById('container'), 'some text to encode')
qrcode.decode(ImageBase64Str, (err, data) => {
if (err) {
return console.log(err)
}
console.log(data)
})
For more qrcode.encode()
options, see Base Usages
npm install
npm run test