Socket
Socket
Sign inDemoInstall

qrcode

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrcode

QRCode / 2d Barcode api with both server side and client side support using canvas


Version published
Weekly downloads
2.5M
increased by3.86%
Maintainers
2
Weekly downloads
 
Created

What is qrcode?

The qrcode npm package is a library for generating QR codes. It can be used to create QR codes in various formats such as images or canvas for web applications, and it supports a range of customization options.

What are qrcode's main functionalities?

Generating QR Code as Data URL

This feature allows you to generate a QR code as a data URL, which can be used directly in image tags or CSS backgrounds.

const QRCode = require('qrcode');
QRCode.toDataURL('https://www.example.com', function (err, url) {
  console.log(url);
});

Generating QR Code as PNG Image File

This feature allows you to generate a QR code and save it as a PNG image file on the filesystem.

const QRCode = require('qrcode');
QRCode.toFile('path/to/output.png', 'https://www.example.com', function (err) {
  if (err) throw err;
  console.log('QR Code saved as image file!');
});

Generating QR Code as UTF8 String

This feature allows you to generate a QR code as a UTF8 string, which can be printed to the terminal or used in text-based formats.

const QRCode = require('qrcode');
QRCode.toString('https://www.example.com', { type: 'terminal' }, function (err, string) {
  if (err) throw err;
  console.log(string);
});

Other packages similar to qrcode

Keywords

FAQs

Package last updated on 05 Aug 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

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