Skip to content

start-local runs a forwarded dev command and automatically infers a port from the current folder name when it ends with ___<port>.

Notifications You must be signed in to change notification settings

matthewbub/start-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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-local

Use 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>
  • PORT env 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.

About

start-local runs a forwarded dev command and automatically infers a port from the current folder name when it ends with ___<port>.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published