New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sexy-qr

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sexy-qr

Sexy SVG QR-code generator

  • 0.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
decreased by-39.13%
Maintainers
1
Weekly downloads
 
Created
Source

Sexy-QR

Sexy SVG QR-code generator

[ >> Online demo << ]

Install

npm install sexy-qr

API

QRCode

Options
FieldTypeDescription
contentstringQR encoded value
ecl'L' / 'M' / 'Q' / 'H'Error correction
Properties:
PropertyDescription
matrixMatrix array
sizeSide size of matrix
Methods:
MethodValuesDescription
emptyCenter(emptySize: number)Remove points in center

QRSvg

Options
FieldTypeDescription
fillstringSVG fill color
sizenumberSize of SVG in px
radiusFactornumberFactor of points corner radius (0-1)
cornerBlockRadiusFactornumberFactor of big squares corner radius (0-3)
cornerBlocksAsCirclesbooleanDraw big corner squares as circles
roundOuterCornersbooleanRound outer corners
roundInnerCornersbooleanRound inner corners
preContentstring / funcPre content of SVG code
postContentstring / funcPost content of SVG code
Properties
PropertyDescription
svgResult SVG code
pathsArray of path-strings
pointSizeSide size of one qr point

Usage

import { QRCode, QRSvg } from 'sexy-qr';

const svgCode = (() => {
  const qrCode = new QRCode({
    content: 'https://avin.github.io/sexy-qr',
    ecl: 'M', // 'L' | 'M' | 'Q' | 'H'
  });

  const qrSvg = new QRSvg(qrCode, {
    fill: '#182026',
    cornerBlocksAsCircles: true,
    size: 380, // px
    radiusFactor: 0.75, // 0-1
    cornerBlockRadiusFactor: 2, // 0-3
    roundOuterCorners: true,
    roundInnerCorners: true,
    preContent: '<!-- QR Code -->',
  });

  return qrSvg.svg;
})();

Demo

Example 1Example 2Example 3Example 4
PreviewPreviewPreviewPreview

License

MIT © avin

Keywords

FAQs

Package last updated on 04 Dec 2023

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