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

p5-snake

v1.1.0

Published

Socket multiplayer snake written with p5.js library

Downloads

3

Readme

p5-snake

npm package with cool socket.io snake so you may have fun with you friends online.

npm install p5-snake

or use built file (description below)


Demo

Demo can be found at http://demos.dagut.ru/npmsnakedemo/


Examples

Examples can be found at https://github.com/DaGuT/p5-snake/tree/master/examples

There are both: react example and pure browser example with built file


Pure HTML Usage

To set it running in html use built version from html examples

Import it and p5.js

Then call

new p5(snakeSketch('BlockID', 'https://snake.dagut.ru:8080'),'BlockID'); //change block id with your DIV ID or whatever element you have

and p5 canvas will appear inside of #BlockID.

Or simply rewrite example that I have


About server

Server files can be found under build/server directory, but feel free to use my server while it's running.

To run server you need to have install "express" and "socket.io"

Simply run command "node snake.js" in that folder and server will be started. If you have ssl sertificates, you can check options varialbe inside of server file.


Rebuilding

If you want to rebuild module after you made some changes you have two options:

  1. For browser go to webpack.config.js and comment line
libraryTarget: 'commonjs2'

Then run

npm run build

and use file from build folder

  1. run
npm run build

replace file from build with the one you have in /node_modules or just copy/paste and import