
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@neovici/cosmoz-router
Advanced tools
A Polymer component to handle client side URL routing and view loading / management
cosmoz-router is a haunted component to handle client side URL routing and view loading / management.
By default cosmoz-router listens to popstate
event
, gets current location href and matches it against the routes defined.
Using npm:
npm install --save @neovici/cosmoz-router
The cosmoz-router element can be imported using:
import '@neovici/cosmoz-router/cosmoz-page-router';
Routes are defined as an Array of Objects:
import { html } from 'lit-html';
import { creteElement, navigate } from '@neovici/cosmoz-router/lib/use-routes';
const routes = [
{
name: 'home', // optional (can be used to identity the route),
rule: /^\/$/iu/, // a Regexp used to matched the route,
handle: ({
url, // the current url string ( that matched the route)
match, // the result of matching route against the rule,
}) => html`<home />`
},
{
name: 'some-page',
rule: (url) => url.startsWith('/some-page'), // function called with current url string
handle: ({ url })=>import('page.js')
.then(()=> createElement('some-element', Object.fromEntries(url.searchParams)))
},
{
name: 'redirect',
rule: /^\/some\-redirect$/iu,
handle: ()=> navigate('#!/', null, {
replace: true, // true to use replaceState,false to use pushState,
notify: true // true to dispatch a `popstate` event
})
}
];
and passed to cosmoz-router:
html`<cosmoz-router .routes=${routes} />`;
See http://neovici.github.io/cosmoz-router (outdated)
TODO
FAQs
A Polymer component to handle client side URL routing and view loading / management
The npm package @neovici/cosmoz-router receives a total of 708 weekly downloads. As such, @neovici/cosmoz-router popularity was classified as not popular.
We found that @neovici/cosmoz-router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.