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

zoo-adventures

v1.1.0

Published

Hang out with the other animals in the zoo

Downloads

11

Readme

zoo-adventures

Play with the other animals in the zoo.

There is no real winner, but you get some extra attention in the zoo when finishing a complete line! You can make one move, then you have to wait for someone else to go ahead before you can make another one.

The game is an experimental demo of p2panda showing how you can build collaborative applications with custom schemas on the network. You can play with it on our website!

Installation

npm i zoo-adventures

Usage

Zoo Adventures is a React component you can embed in your website. It will connect to a p2panda node and allow you to collaboratively play the game in the p2panda network.

import { ZooAdventures } from 'zoo-adventures';

const App = () => {
  return (
    <ZooAdventures />
  );
}

To configure the component you can pass in the following arguments:

  • boardSize: number Dimensions of the board, set to 4 when it is a 4x4 board (defaults to 4)
  • winSize: number Required number of pieces in horizontal, vertical, diagonal row to win (defaults to 3)
  • documentId: string All players play on the same board, this is the document id of it (defaults to 0020823a...)
  • endpoint: string URL of the p2panda node (defaults to http://localhost:2020/graphql)
  • schemaId: string ID of the game board schema, make sure the board size matches the fields (defaults to zoo_adventures_0020da64...)
  • updateIntervalMs: number Interval to fetch latest board game state from node in milliseconds (defaults to 2000)

Development

Setup

# Install NodeJS dependencies
npm install

Register schema

The used schema for this game is already deployed in the p2panda network. If you want to to deploy it on your local node, you can run:

$ npm run schema

Usage: --privateKey [path] --boardSize [num] --endpoint [url]

Options:
      --help        Show help
      --version     Show version number
  -k, --privateKey  Path to file holding private key [default: Demo key]
  -s, --boardSize   Size of the game board, use 4 for "4x4" for example [default: 4]
  -e, --endpoint    Endpoint of p2panda node [default: "http://localhost:2020/graphql"]

It will deploy the schema and create the game board document on your node hosted at http://localhost:2020.

Component

# Check linter errors
npm run lint

# Build library and demo
npm run build

# Watch for changes and automatically run `build`
npm run watch

# Start server to host demo (needs building first)
npm run serve

License

MIT

Supported by

This project has received funding from the European Union’s Horizon 2020 research and innovation programme within the framework of the NGI-POINTER Project funded under grant agreement No 871528 and NGI-ASSURE No 957073