Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Arttse committed Mar 9, 2019
1 parent 419f13f commit 0cc6433
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@
[![Coverage Status](https://coveralls.io/repos/github/Arttse/node.is-url-relative-without-domain/badge.svg?branch=master)](https://coveralls.io/github/Arttse/node.is-url-relative-without-domain?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/arttse/node.is-url-relative-without-domain/badge.svg)](https://snyk.io/test/github/arttse/node.is-url-relative-without-domain)

> Node.js module. Checks if an URL is relative without domain
> Node.js module. Checks if a URL is relative without domain
Version 2 requires Node.js >= 6.13.

## Install

```
$ npm install is-url-relative-without-domain --save
```
or
```
### Package `domains` included
```sh
# NPM
$ npm install is-url-relative-without-domain

# Yarn
$ yarn add is-url-relative-without-domain
```

### Without package `domains`
```sh
# NPM
$ npm install is-url-relative-without-domain --no-optional

# Yarn
$ yarn add is-url-relative-without-domain --ignore-optional

```


## Usage

Expand All @@ -35,6 +47,12 @@ isUrlRelativeWithoutDomain('site.com/show/must?go=on');
//=> false
```

By default package using optional dependency `domains`. But, if you want to using your own list of domains, you can install without optional dependencies and specify code like this:
```js
isUrlRelativeWithoutDomain('site.com/foo/bar', ['com', 'рф', '世界']);
```
In second argument you can add your own array of domains in Unicode.


## License

Expand Down

0 comments on commit 0cc6433

Please sign in to comment.