The Hot Hook runner is a simple process manager that allows you to reload your NodeJS application only when necessary and requested by Hot Hook.
pnpm add @hot-hook/runner
pnpm hot-runner bin/server.js
To use with Typescript, you can pass a hook like this:
# Run with ts-node
pnpm hot-runner --node-args="--loader=ts-node/esm" bin/server.ts
# Run with TSX
pnpm hot-runner --node-args="--import=tsx" bin/server.ts
Clears the console contents after each reload.
Arguments to pass to NodeJS. For example, --node-args="--inspect"
.
Arguments to pass to your script. For example, --script-args="--port=3000"
.