# @zthun/webigail-url

> Url parsing and building.

Latest version **5.0.11** (published 2026-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zthun/webigail-url
pnpm add @zthun/webigail-url
yarn add @zthun/webigail-url
bun add @zthun/webigail-url
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.11 |
| Published | 2026-08-25 |
| First published | 2023-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 116.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anthony Bonta |
| Maintainers | zthun |

## Links

- npm: https://www.npmjs.com/package/@zthun/webigail-url
- Repository: https://github.com/zthun/webigail
- Homepage: https://github.com/zthun/webigail#readme
- Issues: https://github.com/zthun/webigail/issues
- npm.io page: https://npm.io/package/@zthun/webigail-url

## Dependencies (2)

- [lodash-es](https://npm.io/package/lodash-es.md) ^4.18.1
- [url-parse](https://npm.io/package/url-parse.md) ^1.5.10

## Recent versions

- 5.0.11 (latest) — 2026-08-25
- 5.0.10 — 2026-08-24
- 5.0.9 — 2026-08-10
- 5.0.8 — 2026-05-26
- 5.0.7 — 2026-04-26
- 5.0.6 — 2026-04-01
- 5.0.5 — 2026-01-31
- 5.0.3 — 2026-01-02
- 5.0.2 — 2025-12-14
- 5.0.1 — 2025-10-29
- 5.0.0 — 2025-10-23
- 4.0.9 — 2025-10-19
- 4.0.8 — 2025-10-04
- 4.0.7 — 2025-09-09
- 4.0.6 — 2025-09-06
- … 24 more at https://npm.io/package/@zthun/webigail-url/versions

## README

# Webigail URL

It's easy to make mistakes when making REST invocations and public API calls.
Webigail solves this by using the builder pattern to construct a full URL given
different parts of a URI.

## Build Status

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/zthun/webigail/tree/latest.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/zthun/webigail/tree/latest)

## Usage

Webigail is built in TypeScript and it exports both ESM and CJS modules.

```sh
# NPM
npm install @zthun/webigail-url
# Yarn
yarn add @zthun/webigail-url
```

```ts
import { ZUrlBuilder } from "@zthun/webigail-url";

const url = new ZUrlBuilder()
  .protocol("https")
  .hostname("zthunworks.com")
  .subdomain("webigail")
  .build();

// Outputs https://webigail.zthunworks.com
console.log(url);
```

There are also some utility functions for common use cases.

```ts
import { ZUrlBuilder } from "@zthun/webigail-url";

// Note: Browser only unless you're using jsdom in node.  Outputs the current
// browser location with /api appended to it.
const locationUrl = new ZUrlBuilder().location(location).path("/api").build();
console.log(url);

// Url for a persons gravatar if one exists.
const avatar = new ZUrlBuilder()
  .gravatar(md5("john-doe@gmail.com"), 256)
  .build();
console.log(avatar);

// Outputs the existing pieces of the url.
const existingInfo = new ZUrlBuilder()
  .parse("https://webigail.zthunworks.com/api/path?filter=hello")
  .info();
console.log(existingInfo);
```

## Data URLs

Webigail also supports building and parsing data urls as well.

```ts
import { ZDataUrlBuilder, ZMimeTypeApplication } from "@zthun/webigail-url";

const raw = require("my-data.json");
const mimeType = ZMimeTypeApplication.JSON;
const url = new ZDataUrlBuilder()
  .mimeType(mimeType)
  .buffer(Buffer.from(raw))
  .encode("base64")
  .build();
console.log(url);
```

---
_Source: https://npm.io/package/@zthun/webigail-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
