subdomain-collapse
string.replace. collapses www., www1., etc subdomains from pathnames. for standardization, if /www[0-9]?/ and bare domains exist together and need to be treated as the same.
Last updated 7 years ago by tphummel .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install subdomain-collapse 
SYNC missed versions from official npm registry.

subdomain-collapse

collapses www., www1., etc subdomains from pathnames. for standardization, if /www[0-9]?/ and bare domains exist together and need to be treated as the same.

Build Status
NPM

testling badge

install

npm install subdomain-collapse

test

npm test

usage

var sc = require('subdomain-collapse');

var result = sc('www.my-domain.org');
console.log(result);
// my-domain.org

var result2 = sc('www1.my-domain.org');
console.log(result2);
// my-domain.org

var result2 = sc('mail.my-domain.org');
console.log(result2);
// mail.my-domain.org

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

1 Versions

  • 0.1.0                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |