# normalize-file-to-url-path

> normalizes a file to a URL pathname

Latest version **1.0.0** (published 2015-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install normalize-file-to-url-path
pnpm add normalize-file-to-url-path
yarn add normalize-file-to-url-path
bun add normalize-file-to-url-path
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-07-27 |
| First published | 2015-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | url, path, name, file, pathname, files, absolute, relative, urls |

## Links

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

## 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

- 1.0.0 (latest) — 2015-07-27

## README

# normalize-file-to-url-path

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

A simple function to normalize a file path into a [URL path](https://nodejs.org/api/url.html) that can be used when testing `req.url` from an HTTP server.

```js
var toUrl = require('normalize-file-to-url-path')

toUrl('./foo.js')
//=> 'foo.js'

toUrl('foo bar.js')
//=> 'foo%20bar.js'

toUrl('/')
//=> null
```

Experimental -- mostly used internally across some of my tools.

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/normalize-file-to-url-path/blob/master/LICENSE.md) for details.

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