
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
Simple routing for ES6.
$ npm install cv3-route
Inject your routes into the Router class to produce a routable subclass.
Scalar values will be returned directly, methods will be evaluated & returned.
[false] will be called if no other routes match.
import { Inject } from 'cv3-inject/Inject';
import { Router } from 'cv3-route/Router';
const routes = {
index: 'Hello, world!'
, other: 'Other route!'
, [false]: 'Not found!'
};
export class ExampleRouter extends Inject(Router, {routes})
{
// Non-routable methods here
};
Pass a cv3-route/Path object to the route method on the Router object
import { ExampleRouter } from './ExampleRouter';
import { Path } from 'cv3-route/Path';
const exampleRouter = new ExampleRouter;
const emptyPath = new Path('');
const indexPath = new Path('index');
const otherPath = new Path('other');
const errorPath = new Path('does-not-exist');
console.log(exampleRouter.route(emptyPath));
console.log(exampleRouter.route(indexPath));
console.log(exampleRouter.route(otherPath));
console.log(exampleRouter.route(errorPath));
You can route to methods instead of directly returning strings. The router object will be passed as the first parameter, and the current path will be passed as the second parameter.
Internal methods may be called on the router.
import { Inject } from 'cv3-inject/Inject';
import { Router } from 'cv3-route/Router';
const routes = {
'do-something': (router, path) => {
return 'did something.';
}
, 'do-something-else': (router, path) => {
return router.internalMethod();
}
};
export class ExampleRouter extends Inject(Router, {routes})
{
internalMethod()
{
return 'did something.';
}
};
import { ExampleRouter } from './ExampleRouter';
import { Path } from 'cv3-route/Path';
const exampleRouter = new ExampleRouter;
const somethingPath = new Path('do-something');
const somethingElsePath = new Path('do-something-else');
console.log(exampleRouter.route(somethingPath));
console.log(exampleRouter.route(somethingElsePath));
Regex based routing can be achieved with computed property names.
The [square bracket] syntax allows us to maintain regex syntax highlighting in the IDE. Quotes may also be used. Any property starting with a / will be processed as a regex path.
If a method is supplied, it will be called with the match groups from the regex operation as the 3rd parameter.
import { Inject } from 'cv3-inject/Inject';
import { Router } from 'cv3-route/Router';
const routes = {
[/^regex-([-\w]+)$/]: (router, path, matchGroups) => {
return matchGroups[1].split('-').join(',');
}
};
export class ExampleRouter extends Inject(Router, {routes})
{
// Non-routable methods here
};
import { ExampleRouter } from './ExampleRouter';
import { Path } from 'cv3-route/Path';
const exampleRouter = new ExampleRouter;
const onePath = new Path('regex-one');
const twoPath = new Path('regex-one-two');
const threePath = new Path('regex-one-two-three');
console.log(exampleRouter.route(onePath));
console.log(exampleRouter.route(twoPath));
console.log(exampleRouter.route(threePath));
Path objects split their source string on /. This allows us to do nested routing.
import { Inject } from 'cv3-inject/Inject';
import { Router } from 'cv3-route/Router';
const nestedRoutes = {
index: 'Nested index.'
, sub: 'Nested route.'
}
const routes = {
nested: Inject(Router, {routes: nestedRoutes})
};
export class ExampleRouter extends Inject(Router, {routes})
{
// Non-routable methods here
};
import { ExampleRouter } from './ExampleRouter';
import { Path } from 'cv3-route/Path';
const exampleRouter = new ExampleRouter;
const nestedIndexPath = new Path('nested');
const nestedRoutePath = new Path('nested/sub');
console.log(exampleRouter.route(nestedIndexPath));
console.log(exampleRouter.route(nestedRoutePath));
Promises will be passed through, so promise-based routing is simple:
import { Inject } from 'cv3-inject/Inject';
import { Router } from 'cv3-route/Router';
const routes = {
promise: new Promise((accept, reject) => {
accept('fulfilled.');
})
};
export class ExampleRouter extends Inject(Router, {routes})
{
// Non-routable methods here
};
import { ExampleRouter } from './ExampleRouter';
import { Path } from 'cv3-route/Path';
const exampleRouter = new ExampleRouter;
const promisePath = new Path('promise');
exampleRouter.route(promisePath).then((result) => {
console.log(result);
}).catch((error) => {
console.error(error);
});
cv3-route © Sean Morris 2019
All code in this package is relased under the Apache 2.0 licence.
FAQs
Dependency injection code.
The npm package cv3-route receives a total of 6 weekly downloads. As such, cv3-route popularity was classified as not popular.
We found that cv3-route 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
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.