Comparing version 0.4.2 to 0.4.3
import type { Address, BloImage } from "./types"; | ||
export type { Address, BloImage, BloImageData, Hsl, Palette, PaletteIndex, } from "./types"; | ||
export declare function blo(address: Address, size?: number): string; | ||
export declare function bloSvg(address: Address, size?: number): string; | ||
export declare function bloImage(address: Address): BloImage; |
{ | ||
"name": "blo", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"license": "MIT", | ||
@@ -17,5 +17,10 @@ "author": "Pierre Bertet <hi@bpier.re>", | ||
"type": "module", | ||
"module": "dist/blo.js", | ||
"main": "dist/blo.js", | ||
"types": "dist/types.d.ts", | ||
"module": "dist/index.js", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
@@ -36,2 +41,5 @@ "dist" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"scripts": { | ||
@@ -38,0 +46,0 @@ "dev": "vite demo", |
<div align="center"> | ||
<img width="860" alt="blo" src="https://github.com/bpierre/blo/assets/36158/d447bf14-76dc-493c-abea-275703a98945"> | ||
<img width="860" alt="blo" src="https://github.com/bpierre/blo/assets/36158/1ada9bc9-c8d4-4ed6-8bf6-3a70cefce880"> | ||
<br><strong>blo</strong> is a small and fast library to generate Ethereum identicons. | ||
<br><br> | ||
</div> | ||
@@ -18,3 +19,3 @@ | ||
| Library | Renders/s [1] | Size | Types | Environment [2] | Rendering | | ||
| Library | Renders/sec[^1] | Size | Types | Environment[^2] | Rendering | | ||
| ------------------------------------- | --------------------------: | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ---------------------------------------------- | ----------: | | ||
@@ -27,5 +28,5 @@ | <b>blo</b> | <nobr><b>☄️ 7,862</b></nobr> | [![](https://img.shields.io/badge/0.67kB-6ead0a)](https://bundlejs.com/?bundle&q=blo) | ![](https://img.shields.io/badge/yes-6ead0a) | ![](https://img.shields.io/badge/all-6ead0a) | SVG | | ||
[1] The number of renders per second. It was measured on Chrome 117 Linux with an AMD Ryzen 7 PRO 4750U. [See ./benchmark](./benchmark) for the methodology. | ||
[^1]: The number of renders per second. It was measured on Chrome 117 Linux with an AMD Ryzen 7 PRO 4750U. [See ./benchmark](./benchmark) for the methodology. | ||
[2] The term “all” refers to libraries that are framework agnostic and that run in browsers, Bun and Node.js. | ||
[^2]: The term “all” refers to libraries that are framework agnostic and that run in browsers, Bun and Node.js. | ||
@@ -43,11 +44,11 @@ ## Getting Started | ||
img.src = blo("0x…"); | ||
img.src = blo("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"); | ||
``` | ||
### With React | ||
### React / Vue / Others | ||
blo is fast enough to not require memoization for common use cases. | ||
blo is fast enough to not require memoization or async rendering for common use cases. | ||
```tsx | ||
function EthIcon({ address }: { address: `0x${string}` }) { | ||
function AddressIcon({ address }: { address: `0x${string}` }) { | ||
return ( | ||
@@ -77,4 +78,4 @@ <img | ||
img.src = blo("0x…"); // size inside the SVG defaults to 64px | ||
img2.src = blo("0x…", 24); // set it to 24px | ||
img.src = blo(address); // size inside the SVG defaults to 64px | ||
img2.src = blo(address, 24); // set it to 24px | ||
``` | ||
@@ -139,13 +140,18 @@ | ||
- blo is a modernized version of [ethereum-blockies-base64](https://github.com/MyCryptoHQ/ethereum-blockies-base64), which in turn was based on [ethereum/blockies](https://github.com/ethereum/blockies). | ||
- blo is a modernized version of [ethereum-blockies-base64](https://github.com/MyCryptoHQ/ethereum-blockies-base64), which AFAIK was based on [ethereum/blockies](https://github.com/ethereum/blockies). | ||
- This README style was heavily inspired by [colord](https://github.com/omgovich/colord). | ||
- The visual was made in collaboration with [@dizzypaty](https://twitter.com/dizzypaty) 💖. | ||
## FAQ | ||
### Why is it called blo? | ||
### Why is it named blo? | ||
blo is short for blockies, which is the name of the original library. | ||
### Can it be used to generate other types of identicons? | ||
blo implements the Ethereum identicons algorithm only, but you can use it with any type of data, just prefix it with `0x` to fullfill the `Address` type. | ||
## License | ||
[MIT](./LICENSE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17313
88
153