redact-url

0.4.0 • Public • Published

redact-url Build Status

Redact or remove authentication data from URLs

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install redact-url --save

Usage

var redact = require('redact-url');
 
// u:p style
redact('https://suzy:secrets@example.com');
// https://REDACTED@example.com
 
// sketchy query params
redact('https://example.com/password=1');
// https://example.com/password=REDACTED
 
// optional replacment string
redact('https://example.com/password=1', 'XXX');
// https://example.com/password=XXX
 
// clean URLs are untouched
redact('https://no-auth-stuff-here.com');
// https://no-auth-stuff-here.com
 
// non-URLs are untouched
redact("this is not a url");
// this is not a url

Tests

npm install
npm test

License

MIT

Zeke Sikelianos <zeke@sikelianos.com> (http://zeke.sikelianos.com/)

Package Sidebar

Install

npm i redact-url

Weekly Downloads

34

Version

0.4.0

License

MIT

Unpacked Size

6.55 kB

Total Files

7

Last publish

Collaborators

  • zeke