1.0.1 • Published 4 months ago

safer-url v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

safer-url

Wrapper around the native URL type but returns null for invalid URLs instead of throwing an error.

Installation

Install safer-url with your favorite package manager:

npm install safer-url

Usage

import safeURL from 'safer-url';

console.log(safeURL('https://tunnel.dev')); // new URL(...)
console.log(safeURL('invalid')); // null
1.0.1

4 months ago

1.0.0

4 months ago