npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qrencode_mini

v0.0.1

Published

QR Code Generator for node.js

Downloads

3

Readme

qrencode_mini

NPM version NPM Downloads

Node.js addon(N-API) QR-code generator based on libqrencode in C - a fast and compact QR Code encoding library. qrencode_mini module is for node.js server side usage. Implements not all feaures like its original lib has. Produces a buffer as output. That can be encoded to base64 string and added to the image src attribute in a html murkup.

Micro QR feature is some way experimental at the moment.

Dependencies

libpng must be installed.

Installation

npm install qrencode_mini

Usage

There is only one method.

const {qrencode} = require('qrencode_mini');

const options = {
background_color:'#76eec6', // hex string, optional, default: black
foreground_color:'#ff0000', // hex string, optional, default: white
level:"q", // string, optional, default: "l", LOW, 
//can be:"m", Medium
//       "q", Quartile
//       "h", High
dot_size: 6, // number, optional, default: 3
margin:2,    // number, optional, default: 4
micro:0,     // number, optional, default: 0 
// if a string to be encoded to the microQR? 0 means "NO", 1 = "YES"
version:4    // number, optional, default: 0 
// can be 0, 1, 2, 3, 4 //for microQR(if micro=1) must be equal to 3 or 4!!!!
}

let str="bitcoin:1BMXmqU3fZ8PVjPbxgeenEX93YYf74bjeB?amount50&label=John&message=Donation%20for%20project";
let buf=Buffer.from(str);

// a promise:

qrencode(buf, options).then(function(data){
console.log('data: ','data:image/png;base64,'+data.toString('base64'));
}).catch(function(err){console.log('err promise: ',err);
})

The version for microQR if micro = 1, must be specified to 3 or 4!

QR pics

  1. QR encoded "mama"

alt text

  1. microQR encoded "mama"

alt text

Perfomance

  • qrencode_mini is about x3 times faster than qr-node
  • qrencode_mini is about x300 times faster than qrcode-js

| Iterations | 1 | 5 | 100 | | :---------: | :---------: | :---------: | :---------: | | qrencode_mini | 1.871ms | 5.181ms | 5.587ms | | qr-node | 4.940ms | 41.030ms | 519.877ms | | qrcode-js | 297.948ms | 1405.711ms | 9803.455ms |