Mahmudul

TIL: Quickly Inspect package.json Scripts

bashshelljson

1 min read

Not exactly new knowledge, but today I felt like adding another utility alias to my toolkit:

package-scripts() {
  cat package.json | jq ".scripts"
}

This tiny shell function spits out all the scripts defined in your package.json file. It’s a swift way to review available scripts without the hassle of scrolling through endless dependencies in the file.

For those dabbling with nushell, the equivalent command would be a breeze: open package.json | get scripts. Still getting my feet wet with nushell, so for now, this zsh alias will do the job.