generate-avatar
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "generate-avatar", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,7 +0,11 @@ | ||
<p align="center"> | ||
<img src="logo.png"> | ||
<div align="center"> | ||
<img src="logo.png" alt="generate-avatar" /> | ||
</div> | ||
<p> | ||
<div align="center"> | ||
👆 The logo is: `generateFromString('generateavatar')` | ||
</div> | ||
<br/> | ||
</p> | ||
👆 The logo is: `generateFromString('generateavatar')` | ||
[](http://opensource.org/licenses/MIT) | ||
@@ -14,18 +18,25 @@  | ||
# Generate Avatar | ||
# Why use Generate Avatar? | ||
Your lightweight avatar generator, which 100% fingerprinted on any input you want. | ||
A lightweight and blazing fast avatar generator, which is 100% fingerprinted and unique on any input you want. | ||
You can pass your email, uuid, username etc. as an input and it will generate everytime the same unique svg based avatar for you. | ||
Which means you don't need to store any image in your database anymore. | ||
It generates that image on the fly whereever you want based on the id, email and so on. | ||
Pass in your email, uuid, username etc. as an input and it will generate everytime the same unique svg based avatar for you. | ||
The best thing it's only **5kB** big, so it can be basically used everywhere you want. | ||
Which means you don't have to store any generated images in your database anymore. | ||
It generates those images on the fly whereever you want based on the id, email and so on. | ||
The best thing it's only **5 kB** small, so it can be basically used everywhere you want. | ||
### Install | ||
``` | ||
npm i generate-avatar | ||
yarn add generate-avatar | ||
``` | ||
or | ||
``` | ||
npm install generate-avatar | ||
``` | ||
### How it works | ||
@@ -41,6 +52,12 @@ | ||
This will generate the following svg image. | ||
This will generate the svg in a string format. In order to use it, you can use the [image data src attribute](https://css-tricks.com/lodge/svg/09-svg-data-uris/) like this: | ||
``` | ||
<img src={`data:image/svg+xml;utf8,${generateFromString("example@test.com")}`} /> | ||
``` | ||
This will generate and display the following svg image. | ||
 | ||
You can [try it out here](https://generate-avatar.now.sh/). Try to pass in `example@test.com` and you will see the exact same image. | ||
[Try it out here](https://generate-avatar.now.sh/?str=example@test.com) and download the image. You will see that it generates the exact same image everytime. Isn't that amazing ? |
Sorry, the diff of this file is not supported yet
51304
62