# url-parametrized

> Creates URLs from a parametrized url and an object.

Latest version **1.1.3** (published 2021-08-20) · MIT license · 0 weekly downloads

## Install

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

## 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.1.3 |
| Published | 2021-08-20 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dasred |

## Links

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

## Recent versions

- 1.1.3 (latest) — 2021-08-20
- 1.1.2 — 2020-04-24
- 1.1.1 — 2019-07-23
- 1.1.0 — 2019-05-31
- 1.0.5 — 2017-08-30

## README

# url-parametrized
## General
This object provides a easy and simple way to handle parametrized urls. For example this can be 
- https://www.example.com/:paramA/:paramB(/:paramC)

In this case
- :paramA is not optional
- :paramB is not optional
- :paramC is optional

Not optional parameters must be defined if the url should be parsed otherwise an error will be thrown.

## Install
```
npm install url-parametrized --save
```

## Usage
```js
let url = new UrlParametrized('https://www.example.com/:paramA/:paramB(/:paramC)');
console.log(url.parse({paramA: 'nuff', paramB: 'narf', paramC: 'rofl'})); // https://www.example.com/nuff/narf/rofl
console.log(url.parse({paramA: 'nuff', paramB: 'narf'})); // https://www.example.com/nuff/narf
```

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