We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to pass a second level domain as a custom TLD? Looks like it does not work.
e.g. I have foo.example.com and I want to get 'foo' as domain and 'example.com' as TLD.
Sample code:
var parseDomain = require('parse-domain'); var url = "foo.example.com"; var parsed_domain = parseDomain(url, { customTlds:[ "example.com"] }); console.log(parsed_domain);
Output
{ tld: 'com', domain: 'example', subdomain: 'foo' }
Expected Output
{ tld: 'example.com', domain: 'foo', subdomain: '' }
Thank you!
The text was updated successfully, but these errors were encountered:
The customTlds option also accepts regular expressions. You should be able to create a pattern for that case :)
customTlds
Sorry, something went wrong.
No branches or pull requests
Is it possible to pass a second level domain as a custom TLD? Looks like it does not work.
e.g. I have foo.example.com and I want to get 'foo' as domain and 'example.com' as TLD.
Sample code:
Output
Expected Output
Thank you!
The text was updated successfully, but these errors were encountered: