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

cellerity

v1.0.0

Published

Extensible general-purpose cellular automata

Downloads

16

Readme

Cellerity

Cellerity provides general cellular automaton tools. In order to support a variety of uses, it's designed to work with non-numeric cell values, and offers an Automaton class that can be extended to more specific types of cellular automata (e.g. lifelike cellular automata or elementary cellular automata).

The primary focus of the module is the Automaton class, which supports very general cellular automaton functionality. Additionally, a more concrete LifelikeAutomaton subclass makes it easy to simulate any lifelike cellular automaton and serves an example of how to extend the Automaton class.

Other npm packages for cellular automata are available, and probably faster and more convenient for most use cases. Possible reasons to use Cellerity include browser support (which I haven't tested at all recently) and the ability to use objects as cell values. I mostly wrote this as a personal project to experiment with automated documentation, unit tests, and the like, so if it also turns out to be useful for something you're doing, that's just a nice bonus.

Installation

This is an npm package, so naturally it requires Node.js and npm. Install those if you don't have them already.

Note that the package uses some language features that may not be supported in old versions of Node.

To install locally for use in your Node.js project, run npm install cellerity.

If you want to build the documentation, run tests, view examples, or modify the source for the project, clone this repository from the GitHub repository and run npm install in the project's root directory to install the dev dependencies.

Documentation

Auto-generated documentation for the public API can be found online here.

In addition, a usage example using the LifelikeAutomaton class to run Conway's Game of Life in the console is provided.
You can also pass a rule in the "B/S" format (e.g. "B3/S23" for Life) as the first argument to view an automaton other than Life. The script is located at examples/runlife.js.

If you have cloned the repository and installed the dev dependencies, you can build the documentation by running npm run documentation.

Browser Support

If you have cloned the repository and installed the dev dependencies, you can use npm run build to generate a browser-friendly version of the module, located at dist/cellerity-browser-<version>.js.

Including this file in your html page should be equivelant to Node's var cellerity = require("cellerity");

Note: I have not yet tested a wide range of browsers, and the module does use some ES6 functionality, so don't expect support across all browsers currently in use.

Tests

If you have cloned the repository and installed the dev dependencies, you can run unit tests and generate a code coverage report using npm test.

(It seems that the tests require that you be able to run node as "node" rather than "nodejs"; in Ubuntu or Linux Mint, this can be solved by installing the nodejs-legacy legacy symlink package.)

Licence

This package was written by Avery Hiebert and released under the MIT license, as described in LICENCE.txt