get the subdomain from an url
for component:
$ component install ramitos/subdomain.js
for node.js:
$ npm install subdomain.js
with string url:
var subdomain = require('subdomain.js')
subdomain('http://www.example.co.uk') //=> www
with parsed url:
var subdomain = require('subdomain.js'),
url = require('url')
subdomain(url.parse('http://www.example.co.uk')) //=> www
$ npm test
- inspired by URI.js
MIT