# url-file-url

> Small module that converts from URLs to filenames to URLs

Latest version **1.0.5** (published 2025-01-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install url-file-url
pnpm add url-file-url
yarn add url-file-url
bun add url-file-url
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2025-01-11 |
| First published | 2024-02-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Holepunch Inc |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/url-file-url
- Repository: https://github.com/holepunchto/url-file-url
- Issues: https://github.com/holepunchto/url-file-url/issues
- npm.io page: https://npm.io/package/url-file-url

## Dependencies (2)

- [bare-path](https://npm.io/package/bare-path.md) ^3.0.0
- [which-runtime](https://npm.io/package/which-runtime.md) ^1.2.0

## Recent versions

- 1.0.5 (latest) — 2025-01-11
- 1.0.4 — 2024-10-15
- 1.0.3 — 2024-09-24
- 1.0.2 — 2024-02-20
- 1.0.1 — 2024-02-04
- 1.0.0 — 2024-02-04

## README

# url-file-url

Small module that converts from URLs to filenames to URLs

```
npm install url-file-url
```

Useful for embedded runtimes with no `url` module.

## Usage

``` js
const { fileURLToPath, pathToFileURL } = require('url-file-url')

pathToFileURL('/foo/bar') // file:///foo/bar
fileURLToPath('file:///foo/bar') // /foo/bar
```

## License

Apache-2.0

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