
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
node-qr is a simple NodeJS binding to the libqrencode C library written by Kentaro Fukuchi (http://fukuchi.org/works/qrencode/index.en.html).
To use node-qr, you will first need to install the libqrencode C library
For Mac OS X (assumed MacPorts installed)
port install qrencode
For Ubuntu Linux
apt-get install qrencode
Others (see instructions on site)
http://fukuchi.org/works/qrencode/index.en.html
Node-qr is available in the Node Package Manager (NPM)
npm install qr
Currently node-qr only comes with an encoder. The usage is simple
encoder.encode(value, path = null, options = {});
First, require the module
var Encoder = require('qr').Encoder;
var encoder = new Encoder;
The following example will encode a given value and emit an 'end' event with PNG data upon completion
// add an event listener for the 'end' event
// which fires upon encoding completion
encoder.on('end', function(png_data){
// png_data is an instance of Buffer
// do something
});
encoder.encode('some value');
Alternatively, you can pass a file path for the PNG data to be saved to
encoder.on('end', function(){
// if you specify a file path, nothing will be passed to the end listener
// do something
});
encoder.encode('some value', '/tmp/my_qr_file.png');
If at any time an error occurs, an 'error' event will be emitted
encoder.on('error', function(err){
// err is an instance of Error
// do something
});
See the tests in test/qr.js for more ways to use the encoder.
While node-qr and libqrencode can encode images up to 4000 characters, this library makes no attempt to automatically set error correction and version options based on the size of the value (yet, anyway). You are responsible for determining what length your values will be and adjusting the options accordingly.
See 2D QR Code Barcode Generation Guide for more information on limitations of QR Codes and the devices that read them.
The following options can be passed via the third argument of the encode method, which should be an object
For more information around options, see the docs provided for the libqrencoder library here
Feedback and pull requests are always welcomed. This is a work-in-progress. Any help is greatly appreciated.
If you are using Node QR in a production environment, I'd love to know! Send me a PM or email if you don't mind being listed in this readme.
FAQs
Minimal 0-dep QR code generator & reader. Supports ascii, term, gif and svg formats
The npm package qr receives a total of 31,909 weekly downloads. As such, qr popularity was classified as popular.
We found that qr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.