0.0.2 • Published 11 years ago
subdomain.js v0.0.2
subdomain.js
get the subdomain from a url
installation
for component:
$ component install ramitos/subdomain.js
for node.js:
$ npm install subdomain.js
usage
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
test
$ make test
credits
- inspired by URI.js
license
MIT