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 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-p5jsboiler

v2.0.3

Published

A modular p5.js boilerplate project featuring a double pendulum physics simulation. This project demonstrates advanced p5.js concepts including ES6 modules, scene management, event-driven architecture, and game object patterns.

Readme

P5.js Modular Boilerplate

A modular p5.js boilerplate project featuring a double pendulum physics simulation. This project demonstrates advanced p5.js concepts including ES6 modules, scene management, event-driven architecture, and game object patterns.

Features

  • Modular Architecture: Clean separation of concerns with core, entities, scenes, and utilities
  • Event System: Custom event handling for keyboard input and game loop
  • Scene Management: Flexible scene system for managing different game states
  • Pause/Resume: Spacebar controls to pause and resume the simulation

Getting Started

Prerequisites

  • A modern web browser with ES6 module support
  • No build tools required - runs directly in the browser

Installation

  1. Clone the repository:

    git clone https://github.com/ZKitcher/p5js-Boilerplate.git
    cd p5js-Boilerplate
  2. Open index.html in your web browser or serve the project on a local server for live reloading. For example, using live-server:

npx live-server

OR

  • To create a clone, run npx create-p5jsboiler + app-name.
npx create-p5jsboiler app-name
cd app-name

Usage

  • Start: Open index.html in a web browser
  • Pause/Resume: Press the spacebar to pause or resume the simulation
  • Observe: Watch the double pendulum's chaotic motion and color changes

Project Structure

src/
├── main.js              # Application entry point
├── core/
│   ├── Background.js    # Background rendering
│   ├── events.js        # Event system
│   ├── GameObject.js    # Base game object class
│   ├── loop.js          # Game loop management
│   ├── Scene.js         # Base scene class
│   └── SceneManager.js  # Scene management
├── entities/
│   └── DoublePendulum.js # Double pendulum implementation
├── scenes/
│   └── MainScene.js     # Main simulation scene
└── utility/
    └── keyCode.js       # Keyboard constants

Architecture

This boilerplate implements several design patterns:

  • Observer Pattern: Event system for decoupling components
  • Component Pattern: GameObject base class for reusable entities
  • Scene Graph: Hierarchical scene management
  • Module Pattern: ES6 modules for clean imports/exports

Customization

Adding New Entities

  1. Create a new class extending GameObject in the entities/ folder
  2. Implement update() and render() methods
  3. Add the entity to a scene in the scene's constructor

Creating New Scenes

  1. Create a new class extending Scene in the scenes/ folder
  2. Add entities using this.add(entity)
  3. Switch scenes using SceneManager.set(newScene)

Dependencies

  • p5.js v1.9.3 - Creative coding library

License

This project is part of the p5js-Boilerplate repository. See the original repository for licensing information.