1.0.5 • Published 7 years ago

url-steroids v1.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

Installing

yarn add url-steroids

Usage

const URL = require('url-steroids');

// URL.parse
URL.parse('http://google.com')
  .then((res) => {
    console.log(res);
  });

/* Output:
  Url {
    protocol: 'http:',
    slashes: true,
    auth: null,
    host: 'google.com',
    port: null,
    hostname: 'google.com',
    hash: null,
    search: null,
    query: null,
    pathname: '/',
    path: '/',
    href: 'http://google.com/',
    title: 'Google'
  }
  */

  // URL.match
  URL.match('http://blog.mojilala.com/', 'https://mojilala.com')
    .then(() => console.log("It's matching."))
    .catch(() => console.log("It's not matching."));
  /* Output
    It's not matching.
  */

  URL.match('http://cagataycali.xyz/*', 'https://cagataycali.xyz/blog/')
    .then(() => console.log("It's matching."))
    .catch(() => console.log("It's not matching."));
  /* Output
    It's matching.
  */

Tests

npm test

Feel free for contribute

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago