Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

docs

  • Loading branch information...
commit e1b91f255612cf196136f2eb4c9181b9583888b8 1 parent 01895b0
@masylum authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 README.md
View
13 README.md
@@ -7,14 +7,17 @@ top-level domain) from the registered domain and subdomains of a URL.
``` javascript
var tldextract = require('tldextract');
-tldextract('http://forums.news.cnn.com/', console.log);
-//=> null {subdomain: 'forums.news', domain: 'cnn', tld: 'com'}
-tldextract('http://ye.ye.ye.ye/', console.log);
-//=> null {subdomain: 'ye', domain: 'ye', tld: 'ye.ye'}
+tldextract('http://forums.news.cnn.com/', function (err, obj) {
+ // obj: {subdomain: 'forums.news', domain: 'cnn', tld: 'com'}
+});
+
+tldextract('http://ye.ye.ye.ye/', function (err, obj) {
+ // obj: {subdomain: 'ye', domain: 'ye', tld: 'ye.ye'}
+});
```
-## Tests
+## tests
``` bash
make
Please sign in to comment.
Something went wrong with that request. Please try again.