Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
oncletom committed Jan 7, 2013
1 parent 80799b0 commit 53c1a32
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,26 @@ var tld = require('tldjs');
```javascript
tld.getDomain('google.com'); // returns `google.com`
tld.getDomain('fr.google.com'); // returns `google.com`
tld.getDomain('google.co.uk'); // returns `google.co.uk`
tld.getDomain('fr.google.google'); // returns `google.google`
tld.getDomain('foo.google.co.uk'); // returns `google.co.uk`
tld.getDomain('t.co'); // returns `t.co`
tld.getDomain('fr.t.co'); // returns `t.co`
```

### tldExists()

Checks if the TLD is valid for a given host.

```javascript
tld.tldExists('google.com'); // returns `true`
tld.tldExists('google.google'); // returns `false` (not an explicit registered TLD)
tld.tldexists('com'); // returns `true`
tld.tldexists('uk'); // returns `true`
tld.tldexists('co.uk'); // returns `true` (because `uk` is a valid TLD)
tld.tldexists('amazon.fancy.uk'); // returns `true` (still because `uk` is a valid TLD)
tld.tldexists('amazon.co.uk'); // returns `true` (still because `uk` is a valid TLD)
```

### isValid()

```javascript
Expand Down

0 comments on commit 53c1a32

Please sign in to comment.