Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Things Canals does:
Things Canals doesn't do:
The limited scope of its responsibilities make it useful on the server and client! It also makes it really nice to write tests against, because it's all pure functions.
If type signatures appeal to you, Canals.compile works roughly like so:
Canals.compile :: {route: A, ...} -> (url) -> ({args: [arg1, arg2, ...],
query: {queryParam: queryVal, ...},
value: A})
Usage:
var route = Canals.compile({
"posts/:postId": function(postId) { ... }
"posts/:postId/comments/:commentId": function(postId, commendId) { ... },
"download/*path": function(path) { ... },
"edit(/:tab)": function(tab) { ... }
"about": "about",
"": "home"
});
// Note that Canals doesn't *execute* the callback. That's up to you to do,
// if you wish.
route("");
// {args: [], query: {}, value: "home"}
route("about");
// {args: [], query: {}, value: "about"}
route("about?lang=fr&v=2");
// {args: [], query: {"lang": "fr", "v": "2"}, value: "about"}
route("posts/1");
// {args: ["1"], query: {}, value: function(postId) { ... }}
route("posts/1/comments/3");
// {args: ["1", "3"], query: {}, value: function(postId, commentId) { ... }}
route("download/foo/bar/baz?lang=fr");
// {args: ["foo/bar/baz"], query: {"lang": "fr"},
// value: function(postId, commentId) { ... }}
route("edit");
// {args: [null], query: {}, value: function(tab) { ... }}
route("edit/preview");
// {args: ["preview"], query: {}, value: function(tab) { ... }}
route("upload"); // No route defined for "upload"
// null
The syntax for specifying routes was ripped directly from Backbone.Router.
FAQs
URL-source agnostic routing
The npm package canals receives a total of 4 weekly downloads. As such, canals popularity was classified as not popular.
We found that canals 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.