tld.js
v0.0.2
Published
get the tld from a url
Downloads
107
Readme
tldjs
get the tld (top-level-domain) from a url
installation
for component:
$ component install ramitos/tld.js
for node.js:
$ npm install tld.js
usage
with string url:
var tld = require('tld.js')
tld('http://www.example.co.uk') //=> co.uk
with parsed url:
var tld = require('tld.js'),
url = require('url')
tld(url.parse('http://www.example.co.uk')) //=> co.uk
test
$ make test
todo
- test the component version
credits
- inspired by URI.js and the second-level-domain regular expression comes from there
license
MIT