New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dicebear-browser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dicebear-browser

dicebear-browser is a fork of dicebear that allows you to generate avatar images directly in the browser

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

dicebear-browser

dicebear-browser is a fork of dicebear that allows you to generate avatar images directly in the browser. The supported methods are toString and toDataUriSync. This makes it ideal for use in web applications that require quick and easy avatar generation.

Installation

npm install dicebear-browser

Usage

To generate an avatar, create a new avatar object using createAvatar as described here (https://dicebear.com/how-to-use/js-library), then convert the object with toString or toDataUriSync.

import { createAvatar } from "dicebear-browser/core";
import { botttsNeutral } from "dicebear-browser/collection/lib/index";

const avatar = createAvatar(avatars.botttsNeutral, {
    seed: "Angel",
    backgroundColor: ["1e88e5", "fdd835"],
    backgroundType: ["gradientLinear"],
    backgroundRotation: [-270],
    mouth: ["smile02"],
});
document.querySelector("img").src = avatar.toDataUriSync();

License

DiceBear Browser is licensed under the MIT License.

Keywords

dicebear

FAQs

Package last updated on 01 Mar 2023

Did you know?

Socket

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.

Install

Related posts