page-path-builder

1.0.4 • Public • Published

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'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    28
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    28
  • 1.0.3
    168
  • 1.0.2
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i page-path-builder

Weekly Downloads

168

Version

1.0.4

License

WTFPL

Last publish

Collaborators

  • tehshrike