šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@loskir/styled-qr-code-node

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loskir/styled-qr-code-node

Add a style and an image to your QR code

1.5.2
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
Ā 
Created
Source

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

Keywords

qr

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

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.

Install

Related posts