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

hexicon

v1.1.0

Published

A JavaScript library for generating identicons.

Downloads

3

Readme

HEXICON

Gem Version LICENSE

A JavaScript library for generating identicons.

Usage

let hexicon = new Hexicon({
  type: 'square',
  level: 5,
  background: '#f2f2f2',
  random: {
    string: 'Hello'
  }
});
let html = hexicon.toSVG();

which outputs:

Configurations

options

| Name | Type | Default | Description | | - | - | - | - | | type | string | required | The style of the pattern. | | random | object | {} | The data used for randomization. If empty, a random seed is used. | | size | number | 512 | The height and width in pixels of the icon. | | background | string | transparent | The background color of the icon. | | color | string | "normal" | The color of the tiles. The value can be normal, dark, light, or a fixed html color. | | minimum | float | 0.0 | The minimum proportion of the tiles. |

for type=square

| Name | Type | Default | Description | | - | - | - | - | | level | number | 5 | The number of rows and columns. | | symmetrical | bool | true | If the shape is vertically symmetrical. |

for type=hexagon

| Name | Type | Default | Description | | - | - | - | - | | level | number | 4 | The number of layers of the centered hexagonal lattice. | | rotated | bool | false | If true, changes the orientation of the shape. | | symmetrical | bool | true | If the shape is vertically symmetrical. |

for type=concentration

| Name | Type | Default | Description | | - | - | - | - | | level | number | 6 | The number of layers of the concentric polygons. | | sides | number | 6 | The sides of the polygons. | | rotated | bool | false | If true, changes the orientation of the shape. | | bordered | bool | false | If true, always shows the tiles on the outermost layer. | | symmetrical | bool | true | If the shape is vertically symmetrical. |

options.random

Use only one of the following at a time. | Name | Type | Example | | - | - | - | | string | string | "foobar" | | bytes | Array | [0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72] | | hex | string | "666F6F626172" | | seed | number | 249808880 |

Examples

{
  "type": "square"
}
{
  "type": "square",
  "level": 6
}
{
  "type": "square",
  "symmetrical": "false"
}

{
  "type": "hexagon"
}
{
  "type": "hexagon",
  "rotated": true
}
{
  "type": "hexagon",
  "level": 10
}

{
  "type": "hexagon",
  "minimum": 0.4
}
{
  "type": "hexagon",
  "minimum": 0.6
}
{
  "type": "hexagon",
  "minimum": 0.8
}

{
  "type": "ConcentrationGenerator",
  "sides": 5
}
{
  "type": "ConcentrationGenerator",
  "sides": 8
}
{
  "type": "ConcentrationGenerator",
  "bordered": true
}