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

git-hash-art

v0.0.4

Published

Generate beautiful, deterministic abstract art from git commit hashes. Perfect for creating unique visual representations of your project's commits, generating placeholder images, or creating artistic wallpapers.

Downloads

296

Readme

git-hash-art

Generate beautiful, deterministic abstract art from git commit hashes. Perfect for creating unique visual representations of your project's commits, generating placeholder images, or creating artistic wallpapers.

Features

  • Generate consistent, deterministic abstract art from any git hash
  • Configurable canvas sizes and output formats
  • Built-in presets for common social media and device sizes
  • Harmonious color schemes based on hash values
  • Grid-based composition system for balanced layouts
  • Multiple shape types and layering effects
  • Customizable output settings

Installation

npm install git-hash-art

Basic Usage

import { generateImageFromHash } from 'git-hash-art';

// Generate art from a git hash with default settings
const gitHash = '46192e59d42f741c761cbea79462a8b3815dd905';
generateImageFromHash(gitHash);

Advanced Usage

// Custom configuration
const config = {
  width: 1920,
  height: 1080,
  gridSize: 6,
  layers: 7,
  shapesPerLayer: 30,
  minShapeSize: 20,
  maxShapeSize: 180,
  baseOpacity: 0.6,
  opacityReduction: 0.1
};

generateImageFromHash(gitHash, config);

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | width | number | 1024 | Canvas width in pixels | | height | number | 1024 | Canvas height in pixels | | gridSize | number | 4 | Number of grid cells (gridSize x gridSize) | | layers | number | 5 | Number of layers to generate | | shapesPerLayer | number | - | Base number of shapes per layer (defaults to grid cells * 1.5) | | minShapeSize | number | 20 | Minimum shape size | | maxShapeSize | number | 180 | Maximum shape size | | baseOpacity | number | 0.6 | Starting opacity for first layer | | opacityReduction | number | 0.1 | How much to reduce opacity per layer |

Preset Sizes

The package includes several preset configurations for common use cases:

import { PRESETS } from 'git-hash-art-generator';

// Generate an Instagram-sized image
generateImageFromHash(gitHash, PRESETS['instagram'].config);

// Generate a mobile wallpaper
generateImageFromHash(gitHash, PRESETS['phone-wallpaper'].config);

Available presets include:

  • Standard (1024x1024)
  • Banner (1920x480)
  • Ultrawide (3440x1440)
  • Instagram (1080x1080)
  • Instagram Story (1080x1920)
  • Twitter Header (1500x500)
  • LinkedIn Banner (1584x396)
  • Phone Wallpaper (1170x2532)
  • Tablet Wallpaper (2048x2732)
  • Print sizes (A4/A3 at 300 DPI)

CLI Usage

The package includes a command-line interface:

# Generate with default settings
npx git-hash-art current

# Generate from specific hash
npx git-hash-art generate <hash>

# Generate with custom size
npx git-hash-art generate <hash> --width 1920 --height 1080

Integration Examples

GitHub Actions

name: Generate Commit Art
on: [push]
jobs:
  generate-art:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - run: npm install git-hash-art-generator
      - run: npx git-hash-art current --output artwork/

Git Hooks

#!/bin/sh
# .git/hooks/post-commit

hash=$(git rev-parse HEAD)
npx git-hash-art generate $hash --output .git/artwork/

Contributing

Contributions are welcome! Please see our Contributing Guidelines for more details.

License

MIT License - see LICENSE for details.