# url-mask

> Utility for masking url userinfo

Latest version **1.0.5** (published 2016-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install url-mask
pnpm add url-mask
yarn add url-mask
bun add url-mask
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2016-07-21 |
| First published | 2016-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Tanzim Husain |
| Maintainers | tanzim |
| Keywords | url, mask, password, secret, utility, masking |

## Links

- npm: https://www.npmjs.com/package/url-mask
- Repository: https://github.com/tanzim/url-mask
- Homepage: https://github.com/tanzim/url-mask#readme
- Issues: https://github.com/tanzim/url-mask/issues
- npm.io page: https://npm.io/package/url-mask

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.4.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-07-21
- 1.0.3 — 2016-07-12
- 1.0.2 — 2016-07-12
- 1.0.1 — 2016-07-12

## README

# url-mask
Utility for masking url userinfo

[![npm version](https://badge.fury.io/js/url-mask.svg)](https://badge.fury.io/js/url-mask)
[![Dependencies](https://david-dm.org/tanzim/url-mask.svg)](https://github.com/tanzim/url-mask)
[![Build Status](https://travis-ci.org/tanzim/url-mask.svg?branch=master)](https://travis-ci.org/tanzim/url-mask)
[![Coverage Status](https://coveralls.io/repos/github/tanzim/url-mask/badge.svg?branch=master)](https://coveralls.io/github/tanzim/url-mask?branch=master)

## Getting Started
```
$ npm install url-mask
```

## Usage
```javascript
const assert = require('assert');
const urlmask = require('url-mask');
const url = 'http://user:secret@github.com/';

//
// By default both username and password are masked with *
//
let masked = urlmask(url);
assert.equal('http://*****:*****@github.com/', masked);
console.log(`masked url using defaults: ${masked}`);

//
// Additional options can be specified not to mask the username
// or use a different masking character
//
masked = urlmask(url, { maskUsername: false });
assert.equal('http://user:*****@github.com/', masked);
console.log(`masked url overriding maskUsername option: ${masked}`);

masked = urlmask(url, { maskCharacter: '-' });
assert.equal('http://-----:-----@github.com/', masked);
console.log(`masked url overriding maskCharacter option: ${masked}`);
```

## Notes
The mask is always 5 characters long, irrespective of the length of the userinfo (username/password) fields

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