uri-params
v0.1.3
Published
Format uri with variables. It can run both in Node.js runtime and browsers.
Downloads
455
Maintainers
Readme
uri-params
Format uri with variables. It can run both in Node.js runtime and browsers.
Get Started
Use npm to install:
npm install --save uri-params
Use Commonjs/CMD
import uriParams from 'uri-params';
let url = 'http://example.com/:id';
// http://example.com/1
console.log(uriParams(url, {id:1}));
Use in browsers
<script src="http://example.com/public/node_modules/uri-params/dist/uri-params.js"></script>
<script>
window.uriParams('http://example.com/:id', {id:1});
</script>
Feedback
If you have any questions or requirements, use Issues.