0.0.2 • Published 11 years ago

tld.js v0.0.2

Weekly downloads
6,832
License
-
Repository
github
Last release
11 years ago

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 Build Status

$ make test

todo

  • test the component version

credits

  • inspired by URI.js and the second-level-domain regular expression comes from there

license

MIT