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

tamed-state-machine

v1.0.5

Published

A state machine handler for node.js using PostgreSQL.

Downloads

2

Readme

Why?

One of the frequently encountered problems in software development is the need to handle the state machines. Even though the state machine concept is straight forward, handling them is usually hard and open to errors, considering possible points that require intensive care. In order to reduce this repetitive work of handling state machines with the needed intensive care, this project was created.

This project is a state machine handler that is based on a PostgresSQL database. The state machine is defined in the database and the code that handles it is generated from the database. Please note, this library is not a state machine visualization library.

The functions of this library can be comprehended best by walking through a working example because there are 3 distinct parts that need to be understood:

  • Database (state machine configuration)
  • Backend (state machine info exposure)
  • Frontend (the application interface that use the state machine information).

A working example is described here.

Requirements

  1. An Ubuntu server with bash shell.
  2. A PostgresSQL database (the installation method is below, in the Install DB section, below. )

Setup

1. Install DB

tamed-state-machine requires PostgreSQL. If not already installed you can refer to https://www.postgresql.org/ for installation.

For the DB setup follow the steps mentioned here.

2. Prepare Backend

For setting up the fundamentals of the backend follow the steps mentioned here.

3. Prepare Frontend

The frontend functions are handlers that can be embedded into any client application that connects to the backend. This can be a real frontend app like the ones written with, react, react-native or expo. On the other hand there is no limitation for this library for frontend to be a presentation layer. That's why it can also be a backend node application as well.

For setting up the fundamentals of the frontend follow the steps mentioned here.

Example

For a better understanding of how to use this library, please refer to this example.

License

The license is MIT and full text here.