# @openally/auto-url

> Utility to build WHATWG URL from an object payload

Latest version **2.0.0** (published 2026-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @openally/auto-url
pnpm add @openally/auto-url
yarn add @openally/auto-url
bun add @openally/auto-url
```

## Health

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

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-07-29 |
| First published | 2023-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 14 |
| Author | GENTILHOMME Thomas |
| Maintainers | fraxken, pierred |
| Keywords | whatwg, url, utility |

## Links

- npm: https://www.npmjs.com/package/@openally/auto-url
- Repository: https://github.com/OpenAlly/npm-packages
- Homepage: https://github.com/OpenAlly/npm-packages#readme
- Issues: https://github.com/OpenAlly/npm-packages/issues
- npm.io page: https://npm.io/package/@openally/auto-url

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-07-29
- 1.0.1 — 2023-09-30
- 1.0.0 — 2023-09-29

## README

<p align="center"><h1 align="center">
  Auto-URL
</h1>

<p align="center">
  Utility to quickly build WHATWG URL from an Object payload (with custom transformation supported)
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v24 or higher

## Getting Started

This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).

```bash
$ npm i @openally/auto-url
# or
$ yarn add @openally/auto-url
```

## Usage example

```ts
import autoURL from "@openally/auto-url";

const myURL = autoURL(
  "https://www.google.fr",
  { foo: "bar" },
  { foo: (value) => value.toUpperCase() }
);

// https://google.fr/?foo=BAR
console.log(myURL.href);
```

## API

```ts
export type autoURLTransformCallback = (value: string) => string;
export type autoURLTransformConfig<T extends string> = Record<T, autoURLTransformCallback>;

function autoURL<T extends string>(
  source: string | URL,
  payload?: Record<T, any> | Iterable<[T, any]>,
  transformersConfig: autoURLTransformConfig<T>
): URL
```

## License
MIT

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