
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
express-uri-template
Advanced tools
express-uri-template is the reverse of express' application routing.
express:
/forum/:fid/thread/:tid + /forum/hello/thread/world = {"fid": "hello", "tid": "world"}
express-uri-template:
/forum/:fid/thread/:tid + {"fid": "hello", "tid": "world"} = /forum/hello/thread/world
So you can generate urls from templates.
You can use it in the browser, e.g. to generate URLs for AJAX requests or links inserted into the DOM. You can also use it in Node.js, to generate URLs for HTTP redirects or links in generated HTML.
Node.js:
npm install express-uri-template
Bower:
bower install express-uri-template
Use object params:
var eut = require('express-uri-template');
var uri = eut('/forum/:fid/thread/:tid', {"fid": "hello", "tid": "world"});
console.log(uri); // -> /forum/hello/thread/world
Use Array params (aka req.params
):
var eut = require('express-uri-template');
var uri = eut('/forum/*/thread/*', ["hello", "world"]);
console.log(uri); // -> /forum/hello/thread/world
This library is inspired by RFC 6570, except that it uses express' uri template syntax, and is much simpler.
FAQs
Expand express.js style URI templates, similar to RFC 6570
The npm package express-uri-template receives a total of 795 weekly downloads. As such, express-uri-template popularity was classified as not popular.
We found that express-uri-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.