
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.
Functional toolkit for URLs. Drop-in url and
querystring replacement.
Originally built for a static site generator where URL transformations are common, but use-cases
are really unlimited.
Dependencies:
Peer dependencies:
urlquerystring@paqmind/ramda (temp. until basic Ramda)$ npm install urlz
let U = require("urlz")
// The following snippets also use shortcuts for:
let R = require("ramdax")
let UU = require("url")
http://foo.com/bar/baz – absolute URLfoo.com/bar/baz – invalid URL, may occur in human text (*)/bar/baz – root-relative URL (not absolute!)bar/baz – relative URLnormalize-url.
We don't provide normalization heuristics here (yet).format / parse provide limited, low-level, mutable APIThere is also newer WHATWG URL API but it doesn't support relative
URLs. Which basically makes it unusable for many scenarios. So while NodeJS renders url as deprecated
it's still much better than WHATWG version (unsurprisingly).
urlz is trailing slash awareTrailing slash is significant in some cases. It may affect backend routing AND it affects relative URLs:
urlz doesn't assume anything and keeps trailing slash untouched for all operations where it's possible.
urlz respects "relativeness" and "absoluteness" of urlsconsole.log(U.addLeftDir("bar", "/foo.txt")) // "/bar/foo.txt" (+)
console.log(UU.join("bar", "/foo.txt")) // "bar/foo.txt" (-) naive
console.log(U.addRightDir("bar", "/foo.txt")) // "/bar/foo.txt" (+)
console.log(UU.join("/foo.txt", "bar")) // "/foo.txt/bar" (-) naive
urlz is composition friendlylet R = require("ramdax")
let src = "content/team/about.md"
let dst = R.pipe(
U.withLeftDir("public"),
U.addRightDir(P.name(src)),
U.withBase("index.html")
)(src)
console.log(dst) // "public/team/about/index.html"
// corresponding to "/team/about/" URL
urlz is like CRUD for path fragments// GET
console.log(U.leftDir("/foo/bar/baz.txt")) // "foo"
console.log(U.rightDir("/foo/bar/baz.txt")) // "bar"
// UPDATE
console.log(U.withLeftDir ("qux", "/foo/bar/baz.txt")) // "/qux/bar/baz.txt"
console.log(U.withRightDir("qux", "/foo/bar/baz.txt")) // "/foo/qux/baz.txt"
// DELETE
console.log(U.dropLeftDir ("/foo/bar/baz.txt")) // "/bar/baz.txt"
console.log(U.dropRightDir("/foo/bar/baz.txt")) // "/foo/baz.txt"
// ...
urlz provides extra utilsTODO: describe
TODO: describe
FAQs
Functional utils for URLs
We found that urlz 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.