# url-trim

> trims query and hash parameters off a URL

Latest version **1.0.0** (published 2015-09-24) · MIT license · 0 weekly downloads

## Install

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

## 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-09-24 |
| First published | 2015-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | url, trim, strip, path, name, pathname, param, params, query, hash, querystring, string, qs |

## Links

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

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

## README

# url-trim

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

Trims query and hash parameters off of a URL.

## Install

```sh
npm install url-trim --save
```

## Example

```js
var urlTrim = require('url-trim')

urlTrim('http://localhost:9966/?foo=bar')
//=> 'http://localhost:9966/'

urlTrim('/path/foo?blah#bar')
//=> '/path/foo'
```

## Usage

[![NPM](https://nodei.co/npm/url-trim.png)](https://www.npmjs.com/package/url-trim)

#### `trimmed = trim([url])`

Trims the query string and hash parameters from a URL.

If `url` is empty or not a string, this method returns an empty string.

## License

MIT, see [LICENSE.md](http://github.com/Jam3/url-trim/blob/master/LICENSE.md) for details.

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