Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.