Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
knockout-router
Advanced tools
Simple router designed for usage with Knockout JS components with syntax inspired by ReactRouter
<knockout-router rootUrl="/virtualApp" params="actions: actions">
<home-view route="/:userId" action="loadUser"></home-view>
<feeds-view route="/:userId/feeds" action="loadFeeds"></feeds-view>
</knockout-router>
<template id="home-view">
<h1>Home</h1>
<a data-bind="path: '~/' + params.userId() + '/feeds'">Feeds</a>
</template>
<template id="feeds-view">
<h1>Feeds</h1>
<a data-bind="path: '~/' + params.userId() + '/feeds'">Posts</a>
<a data-bind="path: '~/' + params.userId() + '/feeds/images'">Images</a>
<knockout-router routePrefix="/:userId/feeds">
<posts-view route="/"></posts-view>
<images-view route="/images"></images-view>
</knockout-router>
</template>
<template id="posts-view">
<h2>Posts</h2>
</template>
<template id="images-view">
<h2>Images</h2>
</template>
import ko from "knockout";
import "knockout-router";
Array.from(document.querySelectorAll("template"))
.map(node => node.getAttribute("id"))
.forEach(id => {
ko.components.register(id, template: { element: id });
});
ko.applyBindings({
actions: {
async loadUser({ params }) {
let resp = await fetch("/api/users/" + params.userId);
// ...
},
async loadFeeds({ params }) {
let resp = await fetch("/api/feets/" + params.userId);
// ...
}
}
});
TBD
TBD
TBD
FAQs
Simple router designed for usage with Knockout JS components
The npm package knockout-router receives a total of 37 weekly downloads. As such, knockout-router popularity was classified as not popular.
We found that knockout-router 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.