Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

page-path-builder

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

page-path-builder

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

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181
decreased by-13.81%
Maintainers
1
Weekly downloads
 
Created
Source

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

Usage

var buildPath = require('page-path-builder')

var path = buildPath('/wat/:huh/yeah', { huh: 'go figure' })

console.log(path) // => /wat/go%20figure/yeah

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

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

var path = buildPath(parsedPath, { id: 13 })

console.log(path) // => /page/13

var anotherPath = buildPath(parsedPath, { id: 1337 })

console.log(anotherPath) // => /page/1337

Keywords

FAQs

Package last updated on 05 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc