nice-is-url

1.0.2 • Public • Published

nice-is-url

Build Status js-standard-style npm version Coverage Status

var valid = isUrl(val, [options])

Checks if a string is a valid url

  • val (string) - the string to check

  • [options] (object) - defaults to {}

  • options.requireProtocol {boolean} - set to true if you only want URLs with a protocol to be considered valid. Defaults to false

  • returns (boolean) valid - true if val is a valid url, false otherwise

const isUrl = require('nice-is-url')
isUrl('http://localhost:3000') // true
isUrl('boom') // false

Package Sidebar

Install

npm i nice-is-url

Weekly Downloads

10

Version

1.0.2

License

ISC

Last publish

Collaborators

  • vigour-io