Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Routr library is an implementation of router-related functionalities that can be used for both server and client. It follows the same routing rules as Express by using the same library. This library does not use callbacks for routes, instead just mapping them to string names that can be used as application state and used within your application later. For instance in Flux, the current route would be held as state in a store.
For more detailed examples, please check out example applications;
var Router = require('routr'),
router,
route,
path;
router = new Router({
view_user: {
path: '/user/:id',
method: 'get',
foo: {
bar: 'baz'
}
},
view_user_post: {
path: '/user/:id/post/:post',
method: 'get'
}
});
// match route
route = router.getRoute('/user/garfield');
if (route) {
// this will output:
// - "view_user" for route.name
// - {id: "garfield"} for route.params
// - {path: "/user/:id", method: "get", foo: { bar: "baz"}} for route.config
console.log('[Route found]: name=', route.name, 'params=', route.params, 'config=', route.config);
}
// generate url path from route
// "path" will be "/user/garfield/post/favoriteFood"
path = router.makePath('view_user_post', {id: 'garfield', post: 'favoriteFood'});
This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.
Third-pary open source code used are listed in our package.json file.
0.0.4
FAQs
A router for both server and client
The npm package routr receives a total of 370 weekly downloads. As such, routr popularity was classified as not popular.
We found that routr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.