Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swish-qrcode-svg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swish-qrcode-svg

Generate [Swish](https://www.swish.nu) styled QR Code as SVG images.

  • 1.0.0-beta.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Swish QR Code SVG

Generate Swish styled QR Code as SVG images.

Installation

npm install --save swish-qrcode-svg

Usage

const swishQrcodeSvg = require('swish-qrcode-svg')

console.log(swishQrcodeSvg('http://example.com', { margin: 0, backgroundColor: 'transparent' }))
// => <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox=...

Example

API

swishQrcodeSvg(input: string, options?: Options): string

Renders a QR Code with the data in input. Returns a string with the SVG content.

options.backgroundColor: string

Sets the color of the QR Code light patches. Defaults to white.

Note: you can set this value to transparent to not have a background at all.

options.margin: number

Number of additional "points" of the background color on each side. Defaults to 4.

options.size: number

If this option is set, the resulting svg-tag will have it's width and height property set to this value.

Keywords

FAQs

Package last updated on 31 Mar 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc