update-pathname
Update the pathname of a url.
Installation
npm i update-pathname -S
Usage
const updatePathname replacePathname appendIndexFile = // http://localhost/pages/default.html?id=1#top // /pages/default.html?id=1 // http://localhost/index.html?id=1
API
updatePathname(url: string, newPathname: string): string
updatePathname(url: string, update?: (pathname: string) => string): string
replacePathname(url: string, pattern: string|regexp, replacement: string|function): string
appendIndexFile(url: string, indexFilename: string = 'index.html'): string
License
MIT