
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
state-mechanic
Advanced tools
A state machine that tracks and validates state, allows for hide/show logic and can run an action when a state is entered.
And another state machine
npm install state-mechanic
import {StateConfig} from '../StateMachine/model';
import {StateMechanic} from '../StateMachine/stateMechanics';
import assert from 'assert';
export interface CreateListingModel {
type?: 'singleCard' | 'mixedBundle' | 'sealedSingle';
}
export const config: StateConfig<CreateListingModel> = {
type: {
name: 'Create Listing',
url: '/createListing/listing-type',
state: {
singleCard: {
name: 'Single Card',
url: '/createListing/single-card',
validate: (model: CreateListingModel) => {
return model.type === 'singleCard';
},
},
mixedBundle: {
name: 'Mixed Bundle',
url: '/createListing/mixed-bundle',
state: {
title: {
name: 'Title',
url: '/createListing/mixed-bundle/title',
hide: (model?: CreateListingModel) => {
return ['singleCard', 'mixedBundle'].includes(model?.type);
},
},
tagSelection: {
name: 'Tag Selection',
url: '/createListing/mixec-bundle/tag-selection',
hide: (model?: CreateListingModel) => {
return ['singleCard', 'mixedBundle'].includes(model?.type);
},
},
},
},
sealedSingle: {
name: 'Sealed Single',
url: '/createListing/sealed-single',
},
},
},
};
const instance = new StateMechanic(config);
let state = instance.state.type;
state = state.next();
assert(state.name === 'Single Card', "should be single Card");
state = state.next();
assert(state.name === 'Mixed Bundle');
state = state.next();
assert(state.name === 'Title');
expect(1).toBe(1);
FAQs
A state machine that tracks and validates state, allows for hide/show logic and can run an action when a state is entered.
The npm package state-mechanic receives a total of 1 weekly downloads. As such, state-mechanic popularity was classified as not popular.
We found that state-mechanic 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.