# react-steersman-url

> Tiny and Fast URL utils

Latest version **1.0.0** (published 2018-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-steersman-url
pnpm add react-steersman-url
yarn add react-steersman-url
bun add react-steersman-url
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-01-22 |
| First published | 2017-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ivan |
| Maintainers | 3axap4ehko |

## Links

- npm: https://www.npmjs.com/package/react-steersman-url
- Repository: https://github.com/3axap4eHko/react-steersman/tree/master/packages/react-steersman-url
- npm.io page: https://npm.io/package/react-steersman-url

## Recent versions

- 1.0.0 (latest) — 2018-01-22
- 0.1.6 (beta) — 2017-12-04
- 0.4.0 — 2018-01-22
- 0.3.0 — 2017-12-28
- 0.2.0 — 2017-12-19
- 0.1.28 — 2017-12-19
- 0.1.27 — 2017-12-19
- 0.1.26 — 2017-12-15
- 0.1.25 — 2017-12-15
- 0.1.24 — 2017-12-14
- 0.1.23 — 2017-12-14
- 0.1.22 — 2017-12-13
- 0.1.21 — 2017-12-13
- 0.1.20 — 2017-12-13
- 0.1.19 — 2017-12-13
- … 10 more at https://npm.io/package/react-steersman-url/versions

## README

# React Steersman URL

Tiny and Fast URL utils

[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Build Status][travis-image]][travis-url]

## Usage

### URI

```javascript
interface URI {
 protocol      // returns protocol
 username      // returns username if exists otherwise false
 password      // returns password if exists otherwise false
 hostname      // returns hostname
 port          // returns port if exists otherwise false
 host          // returns host
 origin        // returns origin
 path          // returns path
 pathParts     // returns path parts
 query         // returns query
 queryParams   // returns query as object
 hash          // returns hash
 toString()    // converts URI instance to string
 toObject()    // converts URI instance to Object
}

const uri = URI.parse('https://example.com');
console.log(uri.toObject());
```

### Pattern

```javascript
interface Pattern {
  static fromString(url: string): Pattern
  build(params: object): string
  match(url: string): (object|null)
}

const compiled = Pattern.fromString('/user/:userId(\\d+)|int');
const userId = 4520;
const url = compiled.build({ userId });
console.log(url) // /user/4520
const params = compiled.match(url);
console.log(params) // { userId: 4520 }
```

## License
License [The MIT License](http://opensource.org/licenses/MIT)
Copyright (c) 2017-2018 Ivan Zakharchanka

[downloads-image]: https://img.shields.io/npm/dm/react-steersman-transition.svg
[npm-url]: https://www.npmjs.com/package/react-steersman-transition
[npm-image]: https://img.shields.io/npm/v/react-steersman-transition.svg

[travis-url]: https://travis-ci.org/3axap4eHko/react-steersman
[travis-image]: https://img.shields.io/travis/3axap4eHko/react-steersman/master.svg

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