start-local
v0.2.1
Published
Run any local dev command with an inferred port from cwd suffix.
Readme
start-local
start-local runs a forwarded dev command and automatically infers a port from
the current folder name when it ends with ___<port>.
Example:
- Folder:
my-app___3010 - Command:
start-local --forward-cmd="next dev" - Effective command:
next dev --port 3010
Install
npm i -D start-localUse in scripts
{
"scripts": {
"dev": "start-local --forward-cmd=\"next dev\""
}
}Options
--forward-cmd="<command and args>": required command to execute--port-flag="<flag>": flag used when injecting inferred port (default:--port)
Example with Vite:
start-local --forward-cmd="vite"Port precedence
start-local only injects <port-flag> <port> when all are true:
- Folder suffix matches
___<port> PORTenv var is not set- No explicit port argument is passed (
-p,--port, or your custom--port-flag)
All additional args are forwarded to the forwarded command.
