Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

page-path-builder

tehshrike1.4kWTFPL1.0.4

Uses a page.js-style routing string to build up a path you can link to

page, routing

readme

Build Status

For those times when you want to programmatically generate a link to a page.js route.

Usage

var buildPath = require('./')

buildPath('/wat/:huh/yeah', { huh: 'go figure' }) // => '/wat/go%20figure/yeah'

Or parse a path once for more efficient url construction later:

var parsedPath = buildPath('/page/:id')

buildPath(parsedPath, { id: 13 }) // => '/page/13'

buildPath(parsedPath, { id: 1337 }) // => '/page/1337'