Skip to main content
URL.prototype.password - node__url.d.ts - Node documentation
property URL.prototype.password

Usage in Deno

```typescript import { URL } from "node:node__url.d.ts"; ```
Gets and sets the password portion of the URL. ```js const myURL = new URL('https://abc:xyz@example.com'); console.log(myURL.password); // Prints xyz myURL.password = '123'; console.log(myURL.href); // Prints https://abc:123@example.com/ ``` Invalid URL characters included in the value assigned to the `password` property are `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the [parse](../.././node__url.d.ts/~/parse) and [format](../.././node__url.d.ts/~/format) methods would produce.

Type

string