Skip to content

orangemug/create-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Create a URL in a simple human readable way.

Resources

Stars

Watchers

Forks

Packages

No packages published