Explain npm scripts code

Paste the scripts from a package.json and Vibe explains what npm run dev, npm run build and the rest actually run, in what order, and where each command comes from.

shop/package.json

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe19 lines selected

Press Explain it for the sample, or paste your own code first.

What this npm scripts sample shows

npm run
Each entry under scripts is a name and a shell command. npm run build runs the build line, and npm run on its own listed every script. start and test are special enough to have shortcuts: npm start and npm test work without run, while npm run dev needs it.
pre and post
A script named pre plus another script's name runs first. npm run build printed clean: removed dist/ from prebuild, then build: wrote dist/app.js. Each step is announced with a > line, such as > shop@1.2.0 prebuild.
local tools
npm puts the project's own node_modules/.bin first on the PATH while a script runs. After npm install added ESLint 9.39.5, typing eslint --version in the terminal gave eslint: command not found, but npm run lint found it and, for a file with one stray variable, reported 'unused' is assigned a value but never used.
chaining and exit codes
&& runs the next command only if the one before it succeeded. With a lint error, npm run check stopped after ESLint with exit code 1 and npm test never ran; with the error fixed, lint passed and the test ran, exit code 0. That exit code is what CI checks.

Good to know

  • Run with npm 11.10.1 on Node 25.7.0. Before npm install, npm run lint stopped with eslint: command not found and exit code 127: listing a tool in devDependencies isn't enough until it's installed.
  • npm passes the package's fields to scripts as environment variables: npm run hello printed shop v1.2.0 from $npm_package_name and $npm_package_version.
  • npm run nope stopped with npm error Missing script: "nope" and pointed to npm run for the list.

Watch out: Extra arguments for the script go after --. npm run hello -- --loud ran echo ... --loud and printed shop v1.2.0 --loud, but npm test --watch without the -- gave the flag to npm itself: npm warn Unknown cli config "--watch", and node --test ran without it.

Explain npm scripts code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open