0.0.2 • Published 11 years ago

subdomain.js v0.0.2

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

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

$ make test

credits

  • inspired by URI.js

license

MIT