Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Latest commit

 

History

History
44 lines (25 loc) · 747 Bytes

readme.md

File metadata and controls

44 lines (25 loc) · 747 Bytes

subdomain.js

get the subdomain from an 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

$ npm test

credits

license

MIT