Skip to content
/ href-type Public

Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc

Notifications You must be signed in to change notification settings

zeke/href-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

href-type

Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc

Installation

npm install href-type --save

Usage

const hrefType = require('href-type')

hrefType('mailto:zeke@sikelianos.com')  // mailto
hrefType('tel:+15054592942')            // tel
hrefType('sms:+15054592942')            // sms
hrefType('https://example.com')         // absolute
hrefType('http://example.com')          // absolute
hrefType('irc://irc.example.com')       // protocol
hrefType('/foo/bar.html')               // rooted
hrefType('baz/qux.css')                 // relative

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework

License

MIT

Generated by package-json-to-readme

About

Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc

Resources

Stars

Watchers

Forks

Packages

No packages published