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

netwalk-core

v1.2.0

Published

Netwalk game (aka pipes, network) core.

Readme

netwalk-core

Netwalk game (aka pipes, network) core.

Installation

npm i -S netwalk-core

Usage

ES6 import

import * as netwalkCore from 'netwalk-core';
const { Netwalk } = netwalkCore;

const params = {};
const instance = new Netwalk(params);

Script tag in HTML

<script src="netwalk-core.min.js"></script>

then in js

const { Netwalk } = window.netwalkCore

const params = {}
const instance = new Netwalk(params)

By default, instance create matrix, then fill and randomize it.

You can change this behavior by passing params object with fill and randomize boolean fields.

API

Netwalk class

Init params

const params = {
    template,
    rows,
    columns,
    matrix,

    fill,
    fillAnimationDelay,

    randomize,
    randomizeAnimationDelay,


    matrixChangeCallback,
    
    stopwatchChangeCallback,
    movesChangeCallback,
    
    startedChangeCallback,
    finishedChangeCallback,
    
    readyChangeCallback,
    
    matrixRandomizedChangeCallback,
    matrixFilledChangeCallback,
    matrixFillingChangeCallback,
    matrixRandomizingChangeCallback,
}
template (Two dimensional array)
  • 0 is empty cell
  • 1 is consumer or simple cell
  • 'provider' is initial provider cell

The template must be resolvable, otherwise an error will be thrown.

Template examples:

const P = 'provider'

const goodTemplate1 = [
     [1, 1, 1, 1, 1],
     [1, 1, 1, 1, 1],
     [1, 1, 1, 1, 1],
     [1, 1, 1, 1, 1]
 ]
     
const goodTemplate2 = [
     [1, 1, 1, 1, 0],
     [1, 1, P, 1, 0],
     [1, 1, 1, 1, 0],
     [1, 1, 1, 1, 0]
 ]

const badTemplate = [
   [1, 1, 1, 1, 0],
   [1, 1, 1, 1, 0],
   [1, 1, 1, 0, 0],
   [1, 1, 1, 0, 1] // error in last cell 
]
rows (number)
columns (number)
matrix (Matrix with Cells)

if you already have a Matrix instance.

fill (boolean)

Default = true

randomize (boolean)

Default = true

fillAnimationDelay (number)

Delay (in ms) before filling every cell.

Default = 0

randomizeAnimationDelay (number)

Delay (in ms) before randomizing every cell.

Default = 0

Callbacks
  • matrixChangeCallback
  • stopwatchChangeCallback
  • movesChangeCallback
  • startedChangeCallback
  • finishedChangeCallback,
  • readyChangeCallback
  • matrixFillingChangeCallback
  • matrixFilledChangeCallback
  • matrixRandomizingChangeCallback
  • matrixRandomizedChangeCallback

Every callback will be called with the changed value (except matrixChangeCallback).

Instance methods

fillMatrix ()

return Promise

Creates provider (if it doesn't exist), consumers and nodes.

randomizeMatrix ()

return Promise

Randomly changes rotate position of the node.

destroy ()

Stop stopwatch and another internal processes.

rotateNode (id)

Matrix consist of Cell class objects with IDs.

Example:

instance.rotate(Cell.id)

Instance props

  • matrix
  • started
  • finished
  • ready
  • moves
  • stopwatch

Auxiliary constants

import {directions, oppositeConnections, nextConnections, connectionTypes} from 'netwalk-core' 

Can help you in building a view.