The url.hostname is an inbuilt application programming interface of class URL within the url module which is used to get and set the hostname portion of the URL. The url.hostname does not include the port number.
It associates by single value url which is an object created by URL constructor.
Before Change gfg.org After Change geeksforgeeks.org
- Node.js | NPM (Node Package Manager)
- Node js | OS
- Why Node.js ?
- PHP vs. Node.js
- Node | URL.port API
- Node | URL.search API
- Node | URLSearchParams.get()
- Node | URL.username API
- Node | URL.origin API
- Node.js | Basics
- Node | URL.pathname API
- Node | URL.domainToASCII
- Node.js | Web Server
- Node | URL.resolve(from,to) API
- Node | URL.format API
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ManojVarmaPenmatsa