Permalink
Browse files

docs

  • Loading branch information...
1 parent 01895b0 commit e1b91f255612cf196136f2eb4c9181b9583888b8 @masylum committed Sep 18, 2011
Showing with 8 additions and 5 deletions.
  1. +8 −5 README.md
View
@@ -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

0 comments on commit e1b91f2

Please sign in to comment.