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.
vue-boring-avatars
Advanced tools
vue-boring-avatars is a Vue.js port of Boring Avatars, a JS library that generates custom, SVG-based avatars from any username and color palette.
vue-boring-avatars
is a Vue 3 port of Boring Avatars, a JS library that generates custom, SVG-based avatars from any username and color palette.
NPM:
pnpm i vue-boring-avatars
# or
yarn add vue-boring-avatars
# or
npm install vue-boring-avatars
CDN:
<!-- ESM version -->
<script type="module">
import Avatar from "https://unpkg.com/vue-boring-avatars/dist/vue-boring-avatars.js";
</script>
<!-- UMD version -->
<script src="https://unpkg.com/vue-boring-avatars/dist/vue-boring-avatars.umd.cjs"></script>
Props:
size
: number
40
square
: boolean
false
title
: boolean
false
<title>
element or not.name
: string
"Clara Barton"
<title>
element if title
is true
.variant
: string
"bauhaus", "beam", "marble", "pixel", "ring", "sunset"
."marble"
colors
: string[]
["#92A1C6", "#146A7C", "#F0AB3D", "#C271B4", "#C20D90"]
id
: string
Basic usage (with default props):
<template>
<Avatar />
</template>
<script>
import Avatar from "vue-boring-avatars";
export default {
components: {
Avatar,
},
};
</script>
Basic usage with <script setup>
(with default props):
<script setup>
import Avatar from "vue-boring-avatars";
</script>
<template>
<Avatar />
</template>
With props:
<template>
<Avatar :size="80" variant="bauhaus" name="Mujahid Anuar" :colors="colors" />
</template>
<script>
import Avatar from "vue-boring-avatars";
export default {
data() {
return {
colors: ["#92A1C6", "#146A7C", "#F0AB3D", "#C271B4", "#C20D90"],
};
},
components: {
Avatar,
},
};
</script>
With Composition API:
<template>
<input type="text" v-model="name" />
<input type="number" v-model.number="size" />
<Avatar :size="size" variant="bauhaus" :name="name" />
<Avatar
:size="size"
variant="beam"
:name="name"
:square="true"
:title="true"
/>
<Avatar :size="size" variant="marble" :name="name" />
<Avatar
:size="size"
variant="pixel"
:name="name"
:square="true"
:title="true"
/>
<Avatar :size="size" variant="ring" :name="name" />
<Avatar
:size="size"
variant="sunset"
:name="name"
:square="true"
:title="true"
/>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import Avatar from "vue-boring-avatars";
export default defineComponent({
name: "App",
setup() {
const name = ref("Clara Barton");
const size = ref(80);
return {
name,
size,
};
},
components: {
Avatar,
},
});
</script>
pnpm i # install packages
pnpm dev # launch in browser
pnpm test # run tests (download react-boring-avatars, lint, type check, then run tests)
pnpm build # build the dist
Credits to @hihayk (GitHub) and @josep_martins (GitHub) for creating the original Boring Avatars library at boringdesigners!
FAQs
vue-boring-avatars is a Vue.js port of Boring Avatars, a JS library that generates custom, SVG-based avatars from any username and color palette.
The npm package vue-boring-avatars receives a total of 14,715 weekly downloads. As such, vue-boring-avatars popularity was classified as popular.
We found that vue-boring-avatars demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.