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.
@aaronshaf/html-router
Advanced tools
Drop-in router.
<script src="https://unpkg.com/@aaronshaf/html-router@1/hash.js" type="module"></script>
<ul>
<li><a href="#/foo">Foo</a></li>
<li><a href="#/bar">Bar</a></li>
<li><a href="#/baz">Baz</a></li>
</ul>
<hash-switch>
<template data-path="/foo">
<h1>Foo</h1>
</template>
<template data-path="/bar">
<h1>Bar</h1>
</template>
<template data-path="(.*)">
<h1>Not found</h1>
</template>
</hash-switch>
<ul>
<li><a href="#/">Home</a></li>
<li><a href="#/foo">Foo</a></li>
<li><a href="#/foo/bar">Foo and Bar</a></li>
</ul>
<hash-route path="/">
<h2>Home</h2>
</hash-route>
<hash-route path="/foo(.*)">
<h2>Foo</h2>
</hash-route>
<hash-route path="/foo/bar">
<h2>Bar</h2>
</hash-route>
<script src="https://unpkg.com/@aaronshaf/html-router@1/pathname.js" type="module"></script>
<ul>
<li>
<pushstate-link><a href="/foo">Foo</a></pushstate-link>
</li>
<li>
<pushstate-link><a href="/bar">Bar</a></pushstate-link>
</li>
<li>
<pushstate-link><a href="/baz">Baz</a></pushstate-link>
</li>
</ul>
<pathname-switch>
<template data-path="/foo">
<h1>Foo</h1>
</template>
<template data-path="/bar">
<h1>Bar</h1>
</template>
<template data-path="(.*)">
<h1>Not found</h1>
</template>
</pathname-switch>
<ul>
<li>
<pushstate-link><a href="/foo">Foo</a></pushstate-link>
</li>
<li>
<pushstate-link><a href="/foo/bar">Foo & Bar</a></pushstate-link>
</li>
</ul>
<pathname-route path="/foo(.*)">
<h2>Foo</h2>
</pathname-route>
<pathname-route path="/foo/bar">
<h2>Bar</h2>
</pathname-route>
Custom elements that are children of a route or switch can access match data at this.match
.
<style>
hash-switch:not(:defined),
pathname-switch:not(:defined) {
visibility: hidden;
}
</style>
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@2/webcomponents-loader.js"></script>
FAQs
Drop-in router
We found that @aaronshaf/html-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 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.