
Security News
AI Has Taken Over Open Source
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain
@j0u1/finity
Advanced tools
Lightweight finite state machine (FSM) library for TypeScript.
bun add @j0u1/finity
# or
npm install @j0u1/finity
Single transition per state:
import { createMachine } from "@j0u1/finity"
const traffic = createMachine({
initial: "red",
transitions: {
red: "yellow",
yellow: "green",
green: "yellow",
},
})
traffic.current // "red"
traffic.moveTo("yellow") // "yellow"
traffic.canChangeTo("green") // true
traffic.canChangeTo("red") // false
Multiple transitions per state:
const order = createMachine({
initial: "pending",
transitions: {
pending: ["success", "fail"],
success: [],
fail: [],
},
})
order.canChangeTo("success") // true
order.canChangeTo("fail") // true
order.moveTo("success") // "success"
createMachine(config)Creates a new state machine.
| Parameter | Type | Description |
|---|---|---|
config.initial | string | Initial state |
config.transitions | Record<string, string | string[]> | Map of state transitions |
Returns an object with:
current — current statemoveTo(state) — transitions to the given state. Throws if transition is not allowed.canChangeTo(state) — returns true if transition to given state is possible from current stateMIT
FAQs
Lightweight finite state machine library for TypeScript
The npm package @j0u1/finity receives a total of 0 weekly downloads. As such, @j0u1/finity popularity was classified as not popular.
We found that @j0u1/finity demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain

Security News
npm invalidated all granular access tokens that bypass 2FA after a fresh Mini Shai-Hulud wave compromised 323 npm packages. Staged publishing also entered public preview.

Research
/Security News
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.