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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aladas-org/p5-patterns

v0.0.21

Published

P5 extension for lattice patterns

Readme

P5-patterns 0.0.21

Description
This is an extension for P5.js (2D client side drawing library). The purpose of this extension is to ease the generation of tiled/wallpaper/grid patterns. The pattern design is described by a JSON file (e.g. Truchet_PieQuarter.json).

NB: A custom Json Preprocessor (https://github.com/ALADAS-org/json-preprocessor) is used. This is optional of course but thise allows the usage of Named colors (instead of the RGB values in hexadecimal).

  1. Release Notes

    • 1.1. 0.0.21
    • Usage of a custom Json Preprocessor for the color palette of Truchet_PieQuarter and PolygramDemo patterns
    • Support of 3 and 4 branches stars (Shuriken like shapes)
    • 1.2. 0.0.20: added Polygram shape (Polygon an N-star)
  2. Usage

    • 2.1. Install
    • Open a Command Line (cmd.exe)
    • Input these command:
      • git clone https://github.com/ALADAS-org/p5-Patterns.git
      • cd p5-Patterns
      • npm install
    • 2.2. Launch a local Http server with run.bat script

    • 2.3. Double click on demo: it's a URL shortcut (128.0.0.1:8080/)

  3. Pattern language (JSON)

    • Name
      pattern's name, optional but useful if you want to display it in the title bar or status bar

    • Description
      Explains the pattern design, typically it may provide URL(s) to document the principle used (e.g. Truchet

    • Categories
      Used to classify patterns (e.g. Truchet)

    • GridSize
      Grid size in Cell unit, the number of Cells in a row (width) and column (height) of the Grid (e.g. { "width": 27, "height": 15 })

    • CellSize
      Cell size in pixel unit (e.g. { "width": 20, "height": 20 })

    • MaxCellValue
      Each Cell should have a Value (which is typically random), thus MaxCellValue defines the last included version of the values interval (e.g. [0..7], the first value of the interval is always 0)

    • BackgroundColor
      Defines the Background color of the Grid (e.g. #000000 for Black)

    • Shapes
      Defines the Shapes for each possible Cell value (e.g. [0..MaxCellValue]). Available shapes: Line, Rectangle, Ellipse (Ellipse and Arc of Ellipse), Polygram (Polygon and N-star).
      Please find below an extract from Truchet_PieQuarter.json pattern definition file.

	"@include": { "src": "includes/color_palette_Sepia.json", "#type": "COLOR_PALETTE" },
	
    "Shapes": {	
	    "0": [ { "Shape": "Ellipse", "FillColor": "$DoubleSpanishWhite", "Arc": { "start": 0, "end": 90 } } ],
        "1": [ { "Shape": "Ellipse", "FillColor": "$IndianKhaki", "Arc": { "start": 90, "end": 180 } } ],		
		"2": [ { "Shape": "Ellipse", "FillColor": "$Shadow", "Arc": { "start": 180, "end": 270 } } ],	
        ...			  
     }

Note: To force refresh it may be needed to use CTRL F5 to force refresh of the Browser cache. In some cases it's better to close and restart the local Http server