Question: [![built a class i get this error when i run the code](https://i.stack.imgur.com/fekVn.jpg)](https://i.stack.imgur.com/fekVn.jpg)

if unit == 'F': self.number = (number - 32) \* 5/9
UnboundLocalError: local variable 'number' referenced before assignment

Answer: 
No external module is needed to parse URLs in Deno. The [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) class is available as a global, just like in your browser:

```js
const urlString = "https://www.google.com";
const url = new URL(urlString);
console.log(`URL: ${url.protocol}//${url.host}`);
```
Aside from using the ECMA script's native [URL class](https://developer.mozilla.org/en-US/docs/Web/API/URL), as illustrated by [jsejcksn's answer](https://stackoverflow.com/a/71599970/286807), you can also use [url](https://nodejs.org/api/url.html) library from the [/std/node](https://deno.land/std@0.130.0/node) compatibility module as follows:

```js
import * as UrlLib from "https://deno.land/std/node/url.ts";
const url = "https://www.google.com"
const purl = UrlLib.parse(url)
console.log(`URL: ${purl.protocol}//${purl.host}`)

```

Output:

```
URL: https://google.com

```