
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Application URLs model. Replacing static string URLs with hierarchical model.
URLs in our apps are hard-coded.
Building a hierarchical/readable model of URLs.
Instead of '\home' we can write url.home(), or '\profile\'+name+'\photos' -> url.profile.photos(name)
Using urlset is very simple:
var path = require('path');
var urlset = require('urlset');
// sitemap.json contains configuration file for urlset
var links = urlset(require('./sitemap.json'));
// now, where we need to use link '/' we ca use:
links.home();
Configuration file(s) are in json format.
$url - url format for current node;$path - append path for current node and childs;$root - ignore parents $path;{
"home": "/",
"item": "/item/${0}-${1}",
"account": "/account-${name}",
"accounts": {
"$path": "/accounts",
"profile": "/profile",
"photos": "/${0}/photos",
"points":"/${0}/points",
"friends": {
"$url": "/${0}/friends"
}
}
}
Every url in config file can be a string(like "home": "/") or an object: "friends": { "url": "/${0}/friends" }.
This example creates:
links.home(); // with no params, output: '/'
links.item(p0,p1); // with 2 params, output: '/item/p0-p1'
links.accounts.profile(); // with no params, output: '/accounts/profile'
links.accounts.photos(p0); // with one param, output: '/accounts/p0/photos'
links.accounts.points(p0); // with one param, output: '/p0/points' !! link is absolute, so it don't adds '/accounts' prefix
links.accounts.friends(p0); // with one param, output: '/accounts/p0/friends'
links.account({name: 'uniq', lang: 'ru'}); // with one param, output: '/account-uniq?lang=ru'
All urls accept an extra param(object) for query: links.home({lang:'ru',_ref:'home'}) -> '/?lang=ru&_ref=home'
Creates a new links object.
FAQs
Application URLs model. Replacing static string URLs with hierarchical model.
We found that urlset 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.