https://github.com/donavon/build-uri-path
Reliably build a Uri path
https://github.com/donavon/build-uri-path
Last synced: 7 months ago
JSON representation
Reliably build a Uri path
- Host: GitHub
- URL: https://github.com/donavon/build-uri-path
- Owner: donavon
- License: mit
- Created: 2017-11-22T01:47:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-10T03:48:28.000Z (over 7 years ago)
- Last Synced: 2025-01-07T17:16:27.591Z (9 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# build-uri-path
[](https://travis-ci.org/donavon/build-uri-path)
[](https://www.npmjs.com/package/build-uri-path)
[](https://coveralls.io/github/donavon/build-uri-path?branch=master)This is the accompanying source code for the blog post
[Reduce, Reuse, React](https://www.javascriptjanuary.com/blog/reduce-reuse-react)
published for JavaScript January.TL;DR
* Reliably build a Uri path
* Use as a Tagged Template Literal function## Install
```bash
$ npm i --save build-uri-path
```## Usage
```js
import buildUriPath from 'build-uri-path';const resource = 'topic';
const id = 'form/function';const path = buildUriPath`/${resource}/${id}`;
```In this example, `path` would equal "/topic/form%2Ffunction/"