0.0.2 • Published 4 years ago
@dwdarm/url-builder v0.0.2
url-builder
A library for creating URL string with path, URI fragment, and query parameters for NodeJS and browser.
installation
npm install @dwdarm/url-builder
usage
const urlBuilder = require('@dwdarm/url-builder')
// BASIC USAGE
urlBuilder(baseUrl, options = {})
// example:
urlBuilder('http://example.com', {
path: 'path',
hash: 'hash',
query: {
foo: 'bar',
array: ['one', 'two', 'three']
}
})
// output: http://example.com/path?foo=bar&array=one,two,three#hash