# easy-url

> lightweight library for manipulation querystring

Latest version **0.0.3** (published 2017-08-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-08-12 |
| First published | 2017-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mantulenko Nikolai |
| Maintainers | chist13 |
| Keywords | url, query |

## Links

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

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-08-12
- 0.0.2 — 2017-08-12
- 0.0.1 — 2017-08-12

## README

Easy-url
=========

lightweight library for manipulation querystring

## Installation

    npm install easy-url

## Usage

    import Url form 'easy-url'
    window.url = New Url()

## API
### push method
    Updates querystring in your url

    url.push('search', 'foo')
    console.log(location.href) => http://your-site.com?search=foo

    url.push({search: 'foo', page: 5})
    console.log(location.href) => http://your-site.com/home?search=foo&page=5

### clear method
    Removes params from your url

    console.log(location.href) => http://site.com/home?foo=1&bar=2&maz=3

    url.clear('maz')
    console.log(location.href) => http://site.com/home?foo=1&bar=2

    url.clear()
    console.log(location.href) => http://site.com/home

### obj property
    Contains all data from querystring

    console.log(location.href) => http://site.com/home?foo=1&bar=2&maz=3

    console.log(url.obj) => {foo: '1', bar: '2', maz: '3'}

### search property
    Contains querystring

    console.log(location.href) => http://site.com/home?foo=1&bar=2&maz=3

    console.log(url.search) => '?foo=1&bar=2&maz=3'

### on method
    register listener on url change
    returns unsubscribe function

    let off = url.on(function() {console.log('querystring was updated')})

    url.push('key', 'value') => your will see 'querystring was updated' in the console

### off method
    removes listener

    function callback() {/.../}

    url.on(callback)
    url.off(callback)

### once method
    register listener that will fire only once

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