Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Create a URL in a simple human readable way.
JavaScript
branch: master

README.md

create-url

Create a URL/path in a simple human readable way.

browser support

Install

Install the npm package and use browserify or a simular tool to compile.

npm install https://github.com/orangemug/create-url.git

Usage

Any object keys not in the template URL will get added as params.

var createURL = require("create-url");
createURL("/path/{id}?index=3#section-{sectionNum}", {
  id: "badger",
  ref: "mushroom",
  sectionNum: 1
}); // => "/path/badger?index=3&ref=mushroom#section-1"

See tests for more examples.

License

MIT

Something went wrong with that request. Please try again.