# @psf/bip21

> A BIP21 compatible URL encoding utility library

Latest version **2.0.1** (published 2021-01-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install @psf/bip21
pnpm add @psf/bip21
yarn add @psf/bip21
bun add @psf/bip21
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-01-01 |
| First published | 2021-01-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Daniel Cousens |
| Maintainers | psf-account, chris.troutner |
| Keywords | bip21, bitcoin |

## Links

- npm: https://www.npmjs.com/package/@psf/bip21
- Repository: https://github.com/bitcoinjs/bip21
- Issues: https://github.com/bitcoinjs/bip21/issues
- npm.io page: https://npm.io/package/@psf/bip21

## Dependencies (1)

- [qs](https://npm.io/package/qs.md) ^6.3.0

## Recent versions

- 2.0.1 (latest) — 2021-01-01

## README

# bip21

[![build status](https://secure.travis-ci.org/bitcoinjs/bip21.png)](http://travis-ci.org/bitcoinjs/bip21)
[![Version](http://img.shields.io/npm/v/bip21.svg)](https://www.npmjs.org/package/bip21)

A [BIP21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki) compatible URL encoding library.


## Example

``` javascript
var bip21 = require('bip21')

var decoded = bip21.decode('bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar')

console.log(decoded)
// { address: '1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH',
//   options: {
//     amount: 20.3,
//     label: 'Foobar' }
// }
//
// WARNING: Remember to error check the `.address`!

console.log(bip21.encode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'))
// => bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH

console.log(bip21.encode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH', {
	amount: 20.3,
	label: 'Foobar'
}))
// => bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar
```


## License [ISC](LICENSE)

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