Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including stent with all npm packages installed. Try it out:

var stent = require("stent")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

stent v8.0.3

Stent is combining the ideas of redux with the concept of state machines

Stent - brings the power of state machines to the web

Stent is combining the ideas of Redux with the concept of state machines.

Travis npm downloads


A few words about state machines

State machine is a mathematical model of computation. It's an abstract concept where the machine may have different states but at a given time fulfills only one of them. It accepts input and based on that (plus its current state) transitions to another state. Isn't it familiar? Yes, it sounds like a front-end application. That's why this model/concept applies nicely to UI development.

Disclaimer: there are different types of state machines. I think the one that makes sense for front-end development is Mealy state machine.


The library is available as a npm module so npm install stent or yarn add stent will do the job. There's also a standalone version here (only core functionalities) which you can directly add to your page.


Debugging apps made with Stent

Stent is supported by Kuker Chrome extension. Just add the Stent emitter to your app and open the Kuker tab in Chrome's DevTools.


Must-read articles/resources

Other libraries dealing with state machines

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free