npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@barr-media/avatar-builder

v1.0.26

Published

An avatar builder, built in React that outputs SVG code.

Downloads

75

Readme

Avatar Builder

An avatar builder, built in React that outputs SVG code.

Note: These docs will be expanded out over time. This package is playing a role in one of Barr Media's current projects so getting this built for purpose and live has been the priority and therefore, breaking changes and additions are highly likely.

Installation

This package is a React component that you can import into a project. It'll render an avatar builder allowing you to customise an avatar and at the end, output the final SVG.

You can install it via NPM:

npm install @barr-media/avatar-builder

Usage

You can simply import the component and use it as any other in your React project.

import { AvatarBuilder } from '@barr-media/avatar-builder';
<AvatarBuilder onFinish={(svg, json) => {
    // `svg` = output SVG
    // `json` = output JSON
}}/>

This will automatically render the builder.

The builder component requires the prop onFinish as a callback to when you finish and will provide the output SVG and JSON as arguments for you to do what you will with.

Note: This builder contains no CSS rules meaning the output styles will require manual implementation within your project. However, all elements have clear ID's and Classes that use the following convention: AvatarBuilder__[class or id]. This ensures there's no clashing with existing styles.

Roadmap

As mentioned this package has been rapidly built for a current Barr Media piece of work and kept purposefully "barebone" whilst we're building it into the project.

However, the plan will be to fine tune this package to make it more useful for generalised projects.

For Development

To develop, clone this repo to your local machine and in the root of the project run, npm install.

To build for development, simply run npm run build-dev and for production npm run build-prod. This outputs a single JavaScript file in ./dist.

The package is also uploaded to NPM, so to update the package here, bump the version appropriately in package.json and run npm publish.

Credits

The SVG assets used in the builder are from Personas by Draftbit – thanks to these guys for providing these open source.