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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@konnorr/qr-creator

v1.0.1

Published

Lightweight QR code generator for stylish QR codes

Downloads

32

Readme

This is a fork of https://github.com/nimiq/qr-creator

Acknowledgements

  • @Nimick for the original library this was forked from: https://github.com/nimiq/qr-creator

  • @Tomas-M https://github.com/nimiq/qr-creator/pull/17

  • @WickyNilliams https://github.com/nimiq/qr-creator/pull/11

  • @andrin-n-dream https://github.com/nimiq/qr-creator/pull/10

The above PRs were integrated or modified in some way.

qr-creator

A lightweight library generating stylish QR codes that also support gradient fills, rounded corners, different colored corners, and logos in only ~13kB minified (~5kB gzipped). Try out the demo!

Origin

This library is a trimmed down version of Lars Jung's jQuery.qrcode library. Our library is however not based on jQuery anymore and doesnt make use of it. Lars Jung's library itself is based on this QR code Generator.

All parts are licensed under the MIT License.

Installation

To install via npm:

npm install --save @konnorr/qr-creator

To install via yarn:

yarn add @konnorr/qr-creator

Or use a cdn like jsdelivr or unpkg (see usage).

Usage

The library is available as an ES Module. To import it as a module:

  // from installed package for bundling with a module bundler like webpack:
  import QrCreator from 'qr-creator';
  // from cdn:
  import QrCreator from 'https://cdn.jsdelivr.net/npm/qr-creator.js';

Call the QrCreator API with a configuration object and a DOM element or canvas to render the QR code into:

  QrCreator.render({
    text: 'some text',
    radius: 0.5, // 0.0 to 0.5
    ecLevel: 'H', // L, M, Q, H
    fill: '#536DFE', // foreground color
    background: null, // color or null for transparent
    size: 128 // in pixels
  }, document.querySelector('#qr-code'));

Attribute | Options | Default | Description ----------|---------|---------|------------ text | String | "" | Any kind of text, also links, email addresses, any thing. The library will figure out the size of the QR code to fit all the text inside. radius | 0 .. 0.5 | 0.5 | Defines how round the blocks should be. Numbers from 0 (squares) to 0.5 (maximum round) are supported. ecLevel | L, M, Q, H | L | Means "Error correction levels". The four values L, M, Q, and H will use %7, 15%, 25%, and 30% of the QR code for error correction respectively. So on one hand the code will get bigger but chances are also higher that it will be read without errors later on. fill | color or gradient | #000000 | What color you want your QR code to be. Use the demo to try different colors. cornerFill | color or gradient | #000000 | What color you want the 3 corners of your QR code to be. Use the demo to try different colors. background | color code | null | The background color or null for transparent background. size | int | 200 | The total size of the final QR code in pixels - it will be a square. image | string | null | The image (url or data uri) you want to display inside your QR code imageEcCover | 0-1 | 0.5 | How much of the center of the QR code should be covered by the image. The closer you get to 1, the more likely errors will occur in your QR code making it harder to scan. imageBackground | color or gradient | "transparent" | The background of your image. Useful if your image is transparent and you don't want pieces of the QR code bleeding into your image.

If you want to fill the QR code with a gradient, use the following format:

{
    type: 'radial-gradient', // or 'linear-gradient'
    position: [ ... ],
    colorStops: [
        [ offset0, color0 ],
        [ offset1, color1 ],
        ...
    ]
}

Where the position is specified as in createLinearGradient / createRadialGradient. However, each value is relative to the QR code size, i.e. will be multiplied by that size to yield the absolute position.

Trimmed down to be low weight

The goal of the library is to generate QR codes only. For that reason we have removed all additional code such as GIF image generation, background image support, rendering a label on top, removed some dead code, and freed it from depending on jQuery. Also, the resulting library does not use any global variables, is all strict mode, and relies on modern browser standards instead.

Building

To install the dependencies run:

npm install

and then to build the project:

npm run build