1.5.9 • Published 10 months ago

@themaniacalfry/styled-qr-code-node v1.5.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

QR Code Styling

JavaScript library for generating QR codes with a logo and styling.

This is a NodeJS fork of the QR code styling repo qr-code-styling, supporting NodeJs as well as svg exports. If you are looking for browser support head to the original project

Try it here https://qr-code-styling.com

If you have issues / suggestions / notes / questions, please open an issue or contact me. Let's create a cool library together.

Examples

Installation

npm install @loskir/styled-qr-code-node

Usage

import {QRCodeCanvas} from '@loskir/styled-qr-code-node';
const {QRCodeCanvas} = require('@loskir/styled-qr-code-node'); // or CommonJS

const qrCode = new QRCodeCanvas({
  data: 'My text or trl',
  image: 'pathToImage'
});

//"png" | "jpg" | "jpeg" | "pdf" | "svg"
await qrCode.toFile('output.png', 'png');

API Documentation

Styling options

Please refer to the original

Export methods

qrCode.toFile(options) => Promise<void>

ParamTypeDefault ValueDescription
filePathstringthe path where the image will be saved
formatstring ("png" / "jpg" / "jpeg" / "pdf" / "svg")'png'File format
optionsskia-canvas RenderOptionsundefinedsee doc

qrCode.totoDataUrl(options) => Promise<string>

ParamTypeDefault ValueDescription
formatstring ("png" / "jpg" / "jpeg" / "pdf" / "svg")'png'File format
optionsskia-canvas RenderOptionsundefinedsee doc

qrCode.toBuffer(options) => Promise<Buffer>

ParamTypeDefault ValueDescription
formatstring ("png" / "jpg" / "jpeg" / "pdf" / "svg")'png'File format
optionsskia-canvas RenderOptionsundefinedsee doc
1.5.9

10 months ago

1.5.8

10 months ago

1.5.7

10 months ago

1.5.6

10 months ago

1.5.4

10 months ago

1.5.3

10 months ago

1.5.2

10 months ago

1.5.1

10 months ago