Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Kristi is an asynchronous finite state machine engine. It allows you to describe a program (or part of it) using an automata-based approach.
In addition, this is my first experiment with literate programming (with help of a literate-programming-lib).
Kristi is inspired by Machina.js library.
Users of npm can use npm install kristi
.
In other case, use gulp build-min
to get minified UMD-compatible build.
import { Automaton, EVENTS } from 'kristi';
let fsm = new Automaton({
'login-screen-is-shown': {
transitions: {
'user-authenticated' : 'todo-screen-is-shown',
'password-recovery-requested' : 'password-recovery-screen-is-shown',
},
coming() {
let fsm = this; // Automaton instance is set as `this` in `coming` and `leaving`;
// AJAX requests for screen template, etc...
return new Promise((resolve) => {
$('#btn-recover-passw').click(() => {
fsm.processEvent('password-recovery-requested');
});
resolve();
});
},
leaving() {
// Some clean-up
}
},
'todo-screen-is-shown' : {
...
},
...
});
fsm.startWith('login-screen-is-shown');
The "best practice" is to move transition functions out of fsm-schema definition:
let fsm = new Automaton({
'login-screen-is-shown': {
transitions: {
'user-authenticated' : 'todo-screen-is-shown',
'password-recovery-requested' : 'password-recovery-screen-is-show',
},
coming: showLoginScreen,
leaving: hideLoginScreen
}
...
});
Kristi provides simple on/off
interface, so you can subscribe to some events from fsm instance.
fsm.on(EVENTS.TRANSITION, ({from, to}) => {...});
fsm.on(EVENTS.PROCESSING, ({state, event}) => {...});
TODO: add full Event API description.
The full API description could be found here.
FAQs
Simple FSM engine
The npm package kristi receives a total of 3 weekly downloads. As such, kristi popularity was classified as not popular.
We found that kristi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.