C-rank 1 min

Quickly Inspect package.json Scripts

A quick way to check package.json scripts using a shell function.

Quickly Inspect package.json Scripts

Not exactly new knowledge, but today I felt like adding another small utility to my shell toolkit: a quick way to list every script defined in a package.json without scrolling past endless dependencies.

In fish:

function package-scripts
    cat package.json | jq ".scripts"
end

nushell reads JSON natively, so there’s no need for jq at all:

def package-scripts [] {
    open package.json | get scripts
}

A swift way to review the available scripts without the hassle of opening the whole file.