This repository is a mirror of the component module ramitos/subdomain.js. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/ramitos-subdomain.js
. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent.
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