
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
xstate-codegen
Advanced tools
`xstate-codegen` gives you 100% type-safe usage of XState in Typescript. You get type safety on:
xstate-codegen gives you 100% type-safe usage of XState in Typescript. You get type safety on:
on: {EVENT: 'deep.nested.state'}initial attributestate.matches('deep.nested.state')This works by introspecting your machine in situ in your code. With this Thanos-level power, we can click our fingers and give you 100% type safety in your state machines.
xstate-codegen "src/**/**.machine.ts"
Instead of importing createMachine or Machine from xstate, import them from @xstate/compiled:
import { createMachine } from '@xstate/compiled';
const machine = createMachine();
You must pass three type options to createMachine/Machine:
type Event = { type: 'GO' } | { type: 'STOP' };)For instance:
import { Machine } from '@xstate/compiled';
interface Context {}
type Event = { type: 'DUMMY_TYPE' };
const machine = Machine<Context, Event, 'uniqueId'>({});
xstate-codegen "src/**/**.machine.ts" --once
By default, the CLI watches for changes in your files. Running --once runs the CLI only once.
xstate-codegen "src/**/**.machine.ts" --outDir="src"
By default, the CLI adds the required declaration files inside node_modules at node_modules/@xstate/compiled. This writes the declaration files to a specified directory.
Note, this only writes the declaration files to the directory. The
.jsfiles still get written tonode_modules/@xstate/compiled.
FAQs
`xstate-codegen` gives you 100% type-safe usage of XState in Typescript. You get type safety on:
We found that xstate-codegen 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.