Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@svelte-put/avatar
Advanced tools
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
npm install -D @svelte-put/avatar
yarn add -D @svelte-put/avatar
pnpm add -D @svelte-put/avatar
Currently, gravatar and UIAvatar are supported. If you find that another avatar server is worth mapping to, please propose through an issue.
<script>
import Avatar from '@svelte-put/avatar/Avatar.svelte';
import { gravatar, uiAvatar } from '@svelte-put/avatar';
const simpleGravatarUrl = gravatar('johndoe@domain.com');
const complexGravatarUrl = gravatar({
email: 'johndoe@domain.com',
rating: 'r',
size: 32,
});
const simpleUIAvatarUrl = uiAvatar('John+Doe');
const complexGravatarUrl = uiAvatar({
name: 'John+Doe',
rounded: true,
length: 3,
bold: true,
size: 32,
format: 'svg',
});
</script>
<!--
Multiple resolution strategy can be provided as props.
If one url does not point to a valid resource, the next will
be used until all are exhausted and an internal fallback (https://www.gravatar.com/avatar?d=mp) is used instead.
Resolution flow is shown below:
src -> gravatar -> uiAvatar -> fallback -> internal fallback
-->
<Avatar
class="rounded-full"
src="https://johndoe.com/avatar.png"
gravatar="johndoe@domain.com"
uiAvatar="John+Doe"
fallback="https://johndoe.com/fallback.png"
size={32}
>
</Avatar>
<Avatar
src="https://johndoe.com/avatar.png"
gravatar={{ email: 'johndoe@domain.com', rating: 'pg' }}
uiAvatar={{ name: 'John+Doe', background: '333333', color: 'FFFFFF' }}
fallback="https://johndoe.com/fallback.png"
size={32}
>
<svelte:fragment let:src>
<img {src} alt="custom" />
</svelte:fragment>
</Avatar>
For detailed documentation, see the extracted API. It is recommended to skim through at least the AvatarProps page so that you know what options are available.
FAQs
Component and utils for handling avatar
We found that @svelte-put/avatar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.