object URL extends Object
This module has utilities for URL resolution and parsing. Call require('url') to use it.
- Annotations
- @native() @JSImport( "url" , JSImport.Namespace )
- Alphabetic
- By Inheritance
- URL
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
domainToASCII(domain: String): String
Returns the Punycode ASCII serialization of the domain.
Returns the Punycode ASCII serialization of the domain. If domain is an invalid domain, the empty string is returned.
- domain
the domain
- returns
the Punycode ASCII serialization of the domain
-
def
domainToUnicode(domain: String): String
Returns the Unicode serialization of the domain.
Returns the Unicode serialization of the domain. If domain is an invalid domain, the empty string is returned.
- domain
the domain
- returns
the Unicode serialization of the domain
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def fileURLToPath(url: String): String
- def fileURLToPath(url: URL): String
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def format(url: URL): String
-
def
format(url: URL, options: UrlFormatOptions): String
Returns a customizable serialization of a URL String representation of a WHATWG URL object.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pathToFileURL(url: String): URL
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Deprecated Value Members
-
def
format(urlObj: URLObject): String
Take a parsed URL object, and return a formatted URL string.
Take a parsed URL object, and return a formatted URL string.
- Annotations
- @deprecated
- Deprecated
(Since version Node.js v11.0.0) Use URL instead
url.format(urlObj)
Example: -
def
parse(urlStr: String): URLObject
- Annotations
- @deprecated
- Deprecated
(Since version Node.js v11.0.0) Use URL instead
-
def
parse(urlStr: String, parseQueryString: Boolean): URLObject
- Annotations
- @deprecated
- Deprecated
(Since version Node.js v11.0.0) Use URL instead
-
def
parse(urlStr: String, parseQueryString: Boolean, slashesDenoteHost: Boolean): URLObject
Take a URL string, and return an object.
Take a URL string, and return an object.
Pass true as the second argument to also parse the query string using the querystring module. If true then the query property will always be assigned an object, and the search property will always be a (possibly empty) string. If false then the query property will not be parsed or decoded. Defaults to false.
Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' } rather than { pathname: '//foo/bar' }. Defaults to false.
- Annotations
- @deprecated
- Deprecated
(Since version Node.js v11.0.0) Use URL instead
url.parse(urlStr[, parseQueryString][, slashesDenoteHost])
Example: -
def
resolve(from: String, to: String): String
Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. Examples: url.resolve('/one/two/three', 'four') // '/one/two/four' url.resolve('http://example.com/', '/one') // 'http://example.com/one' url.resolve('http://example.com/one', '/two') // 'http://example.com/two'
- Annotations
- @deprecated
- Deprecated
(Since version Node.js v11.0.0) Use URL instead
url.resolve(from, to)
Example: