Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@aaronshaf/html-router
Advanced tools
Readme
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
The npm package @aaronshaf/html-router receives a total of 16 weekly downloads. As such, @aaronshaf/html-router popularity was classified as not popular.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.