safer-url
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i safer-url

Weekly Downloads

0

Version

1.0.1

License

none

Unpacked Size

988 B

Total Files

5

Last publish

Collaborators

  • leondreamed
  • leonsilicon