npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wefabric/telqr

v1.0.2

Published

A JavaScript library for handling telephone links with QR code generation on desktop devices

Downloads

26

Readme

TelQr

A lightweight JavaScript library that enhances telephone links on desktop devices by displaying QR codes for easy mobile scanning. Perfect for bridging the gap between desktop and mobile phone functionality.

Features

  • Automatically detects desktop devices and intercepts tel: links
  • Displays QR codes for phone numbers on desktop devices
  • Fully customizable styling and configuration
  • Bypasses QR functionality on mobile devices (preserves native calling)
  • Lightweight with minimal dependencies
  • Easy integration with existing websites

Installation

npm install @wefabric/telqr

Usage

Basic Usage

// Import the library
import TelQr from '@wefabric/telqr';

// Initialize with default settings
document.addEventListener('DOMContentLoaded', () => {
    new TelQr();
});

With Custom Configuration

import TelQr from '@wefabric/telqr';

document.addEventListener('DOMContentLoaded', () => {
    new TelQr({
        showToCallText: 'Click to call',
        scanToCallText: 'Scan with your phone to call',
        buttonText: 'Call Now',
        qrCode: {
            width: 200,
            height: 200,
            correctLevel: 'H',
            colorDark: '#000000',
            colorLight: '#ffffff'
        },
        styling: {
            modal: {
                background: '#ffffff',
                borderRadius: '16px',
                padding: '32px',
                maxWidth: '350px'
            },
            button: {
                background: '#007cba',
                color: 'white',
                fontSize: '16px'
            }
        }
    });
});

Browser Script Tag

<script src="path/to/telqr/src/TelQr.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        new TelQr({
            scanToCallText: 'Scan to call',
            buttonText: 'Call Now'
        });
    });
</script>

Configuration Options

Text Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | showToCallText | string | 'Show to call' | Aria label for the modal | | scanToCallText | string | 'Scan to call' | Description text below QR code | | buttonText | string | 'Call Now' | Text for the call button |

QR Code Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | qrCode.width | number | 180 | QR code width in pixels | | qrCode.height | number | 180 | QR code height in pixels | | qrCode.correctLevel | string | 'M' | Error correction level (L, M, Q, H) | | qrCode.colorDark | string | '#000000' | Dark color for QR code | | qrCode.colorLight | string | '#ffffff' | Light color for QR code |

Styling Configuration

Modal Styling

styling: {
    modal: {
        background: '#fff',
        border: '1px solid #e5e7eb',
        borderRadius: '12px',
        padding: '24px',
        boxShadow: '0 20px 50px rgba(0,0,0,.2)',
        maxWidth: '300px'
    }
}

Backdrop Styling

styling: {
    backdrop: {
        background: 'rgba(0, 0, 0, 0.5)'
    }
}

Button Styling

styling: {
    button: {
        marginTop: '16px',
        padding: '12px 20px',
        background: '#007cba',
        color: 'white',
        border: 'none',
        borderRadius: '6px',
        cursor: 'pointer',
        fontSize: '14px',
        width: '100%'
    }
}

How It Works

  1. Device Detection: The library automatically detects if the user is on a mobile device
  2. Mobile Bypass: On mobile devices, telephone links work normally (native calling)
  3. Desktop Enhancement: On desktop devices, clicking a tel: link shows a QR code modal
  4. QR Code Generation: Uses the QRCode.js library to generate scannable QR codes
  5. Fallback: Includes a "Call Now" button that still triggers the tel: link

Dependencies

  • qrcodejs: Used for QR code generation (loaded automatically from CDN)

Browser Support

  • Modern browsers that support ES6 classes
  • Internet Explorer 11+ (with polyfills)
  • All major mobile browsers

Examples

Basic HTML Setup

<!DOCTYPE html>
<html>
<head>
    <title>TelQr Example</title>
</head>
<body>
    <p>Call us: <a href="tel:+1234567890">+1 (234) 567-8900</a></p>
    <p>Support: <a href="tel:+0987654321">+0 (987) 654-321</a></p>
    
    <script src="path/to/telqr.js"></script>
    <script>
        new TelQRHandler({
            scanToCallText: 'Scan with your phone to call',
            buttonText: 'Call Now'
        });
    </script>
</body>
</html>

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.