function parse
Jump to headingparse(urlString: string): UrlWithStringQuery
Deprecated
The url.parse()
method takes a URL string, parses it, and returns a URL
object.
A TypeError
is thrown if urlString
is not a string.
A URIError
is thrown if the auth
property is present but cannot be decoded.
url.parse()
uses a lenient, non-standard algorithm for parsing URL
strings. It is prone to security issues such as host name spoofing and incorrect handling of usernames and passwords. Do not use with untrusted
input. CVEs are not issued for url.parse()
vulnerabilities. Use the WHATWG URL
API instead.
Parameters Jump to heading
Jump to headingurlString: string
The URL string to parse.
Return Type Jump to heading
Jump to headingparse(urlString: string,parseQueryString: false | undefined,slashesDenoteHost?: boolean,): UrlWithStringQuery
Parameters Jump to heading
Jump to headingurlString: string
Jump to headingparseQueryString: false | undefined
optional
Jump to headingslashesDenoteHost: boolean
Return Type Jump to heading
Jump to headingparse(urlString: string,parseQueryString: true,slashesDenoteHost?: boolean,): UrlWithParsedQuery
Parameters Jump to heading
Jump to headingurlString: string
Jump to headingparseQueryString: true
optional
Jump to headingslashesDenoteHost: boolean
Return Type Jump to heading
Jump to headingparse(urlString: string,parseQueryString: boolean,slashesDenoteHost?: boolean,): Url
Parameters Jump to heading
Jump to headingurlString: string
Jump to headingparseQueryString: boolean
optional
Jump to headingslashesDenoteHost: boolean