Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT License.
A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT license.
Specify finite state machines with a brief syntax. Run them. Derive charts from them. Save and load states. Make factories. Impress friends and loved ones. Cure corns and callouses.
const traffic_light = new jssm.machine({
initial_state : 'Red',
transitions : [
{ action: 'Proceed', from:'Green', to:'Yellow' },
{ action: 'Proceed', from:'Yellow', to:'Red' },
{ action: 'Proceed', from:'Red', to:'Green' }
]
});
// use with actions
traffic_light.state(); // 'Red'
traffic_light.action('Proceed'); // true
traffic_light.state(); // 'Green'
traffic_light.action('Proceed'); // true
traffic_light.state(); // 'Yellow'
traffic_light.action('Proceed'); // true
traffic_light.state(); // 'Red'
// use with transitions
traffic_light.transition('Yellow'); // false (lights can't go from red to yellow, only to green)
traffic_light.state(); // 'Red'
traffic_light.transition('Red'); // false (lights can't go from red to red, either)
traffic_light.state(); // 'Red'
traffic_light.transition('Green'); // true
traffic_light.state(); // 'Green'
Which you can see being hand-executed in the console here:
There are a lot of state machine impls for JS, many quite a bit more mature than this one. Here are some options:
And some similar stuff:
FAQs
A Javascript finite state machine (FSM) with a terse DSL and a simple API. Most FSMs are one-liners. Fast, easy, powerful, well tested, typed with TypeScript, and visualizations. MIT License.
The npm package jssm receives a total of 1,708 weekly downloads. As such, jssm popularity was classified as popular.
We found that jssm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.