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

handonweb-wa-link

v1.0.0

Published

Generate WhatsApp click-to-chat links and buttons with pre-filled messages

Downloads

92

Readme

handonweb-wa-link

Generate WhatsApp click-to-chat links and HTML buttons with pre-filled messages. Zero dependencies.

Install

npm install handonweb-wa-link

Usage

const { waLink, waButton } = require('handonweb-wa-link');

// Simple link
const url = waLink('447471487274', 'Hello!');
// => https://wa.me/447471487274?text=Hello!

// With country code (strips leading zero automatically)
const ukUrl = waLink('07471487274', 'Hi', { countryCode: '44' });
// => https://wa.me/447471487274?text=Hi

// Use api.whatsapp.com instead of wa.me
const apiUrl = waLink('447471487274', 'Hi', { useApi: true });
// => https://api.whatsapp.com/send?phone=447471487274&text=Hi

// Generate an HTML button
const html = waButton('447471487274', 'Need help?');
// => <a href="https://wa.me/..." style="..." target="_blank">Chat on WhatsApp</a>

// Custom button styling
const custom = waButton('447471487274', 'Hi', {
  text: 'Message Us',
  color: '#128C7E',
  textColor: '#fff',
  borderRadius: '20px',
  fontSize: '14px',
  padding: '10px 20px',
});

API

waLink(phone, message?, options?)

Returns a WhatsApp chat URL string.

| Param | Type | Description | |-------|------|-------------| | phone | string | Phone number (any format — spaces, dashes, brackets OK) | | message | string | Pre-filled message (optional) | | options.countryCode | string | Country code to prepend, e.g. "44" | | options.useApi | boolean | Use api.whatsapp.com instead of wa.me |

waButton(phone, message?, style?)

Returns an HTML anchor tag styled as a button.

| Param | Type | Default | |-------|------|---------| | style.text | string | "Chat on WhatsApp" | | style.color | string | "#25D366" | | style.textColor | string | "#ffffff" | | style.borderRadius | string | "8px" | | style.fontSize | string | "16px" | | style.padding | string | "12px 24px" | | style.countryCode | string | — | | style.useApi | boolean | false |

About Hand On Web

We build AI chatbots, voice agents, and automation tools for businesses.

Licence

MIT