# @whizzes/walink

> WhatsApp Links Generation Utilities

Latest version **0.1.0** (published 2023-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @whizzes/walink
pnpm add @whizzes/walink
yarn add @whizzes/walink
bun add @whizzes/walink
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-02-02 |
| First published | 2023-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Esteban Borai |
| Maintainers | estebanborai |

## Links

- npm: https://www.npmjs.com/package/@whizzes/walink
- Repository: https://github.com/whizzes/walink
- Homepage: https://github.com/whizzes/walink#readme
- Issues: https://github.com/whizzes/walink/issues
- npm.io page: https://npm.io/package/@whizzes/walink

## Recent versions

- 0.1.0 (latest) — 2023-02-02

## README

<div>
  <h1 align="center">walink</h1>
  <h4 align="center">
    WhatsApp Links Generation Utilities
  </h4>
</div>

<div align="center">

![Build](https://github.com/whizzes/walink/workflows/build/badge.svg)
![Tests](https://github.com/whizzes/walink/workflows/test/badge.svg)
![Lint](https://github.com/whizzes/walink/workflows/lint/badge.svg)
![Publish](https://github.com/whizzes/walink/workflows/publish/badge.svg)
[![Version](https://img.shields.io/npm/v/@whizzes/walink.svg?style=flat)](https://www.npmjs.com/package/@whizzes/walink)
[![Downloads](https://img.shields.io/npm/dm/@whizzes/walink.svg?style=flat)](https://www.npmjs.com/package/@whizzes/walink)

</div>

## Getting Started

Install in your project

```bash
npm i @whizzes/walink

yarn add @whizzes/walink

pnpm i @whizzes/walink
```

## Usage

Theres two ways you can consume this package in your code. By either providing
a singleton-like `WhatsAppLinkMaker` instance, or using the utility function:
`makeWhatsAppLink`.

### Using `WhatsAppLinkMaker` instance

The `WhatsAppLinkMaker` instance allows you to specify the phone number to
use once and then make multiple messages with a single instance.

```ts
import { WhatsAppLinkMaker } from '@whizzes/walink';

const waLink = new WhatsAppLinkMaker('+112312344321');
const productLink = 'https://example.com/products/1';
const link = waLink.make(
  `Hello I would like to know more about this product: ${productLink}`,
);
```

### Using `makeWhatsAppLink` utility function

If you need to use different phone numbers on every message, the `makeWhatsAppLink`
function will be useful instead.

```ts
import { makeWhatsAppLink } from '@whizzes/walink';

const phoneNumber = '+112312344321';
const productLink = 'https://example.com/products/1';
const message = `Hello I would like to know more about this product: ${productLink}`;
const link = makeWhatsAppLink(phoneNumber, message);
```

## License

Licensed under the MIT License

---
_Source: https://npm.io/package/@whizzes/walink · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
