@googlicius/build-url
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@googlicius/build-url", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Build url helper", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -8,3 +8,3 @@ # BUILD URL | ||
``` | ||
npm install build-url | ||
npm install @googlicius/build-url | ||
``` | ||
@@ -15,3 +15,3 @@ | ||
``` | ||
yarn add buil-url | ||
yarn add @googlicius/buil-url | ||
``` | ||
@@ -32,1 +32,26 @@ | ||
``` | ||
Add another query param: | ||
```javascript | ||
import buildUrl from 'build-url'; | ||
buildUrl('http://my-website.com/post?page=2', { | ||
queryParams: { | ||
sort: 'title:asc', | ||
}, | ||
}); | ||
// Output: http://my-website.com/post?page=2&sort=title%3Aasc | ||
``` | ||
Remove a query param: | ||
```javascript | ||
buildUrl('images?page=2&sort=title:asc', { | ||
queryParams: { | ||
page: null, | ||
}, | ||
}); | ||
// Output: /images?sort=title%3Aasc | ||
``` |
3306
55