npm-scripts

Execute npm scripts and npx commands with argument forwarding and environment variables.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill npm-scripts-theslashdojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npm-scripts
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/node/npm/scripts
Command: npx skills add https://github.com/theslashdojo/dojo --skill npm-scripts-theslashdojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill provides a consistent, agent-friendly way to define, run, and compose npm scripts and npx commands so developers and automation agents can execute build, test, lint, and dev workflows without manual setup or platform troubleshooting.

Core Features & Use Cases

  • Run Scripts: Execute named npm scripts and built-in shortcuts such as test and start.
  • Lifecycle Hooks: Handle pre and post hooks and follow install, publish, and version lifecycle ordering.
  • npx and npm exec: Run packages temporarily without global installs and resolve local binaries first.
  • Argument Forwarding & Env Injection: Forward arguments to scripts and inject environment variables for flexible runs.
  • Composition & Cross-Platform: Compose pipelines, run scripts in sequence or parallel, and use tools to improve Windows/Unix compatibility.
  • Use Case: Automate a CI step that runs lint, typecheck, and tests with environment-specific flags and argument forwarding.

Quick Start

Run the npm-scripts skill to execute the build script with NODE_ENV=production and forward any additional arguments to the underlying script.

Frequently Asked Questions about npm-scripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run npm scripts and pass arguments to the underlying build or test commands?

Run npm scripts with argument forwarding to pass flags and arguments directly to underlying build or test commands. You can also inject environment variables like NODE_ENV=production for flexible, context-specific execution.

How do npm lifecycle hooks work and can I run pre and post scripts automatically?

npm lifecycle hooks automatically execute pre and post scripts before or after named commands. They follow install, publish, and version lifecycle ordering to automate setup and cleanup tasks without manual intervention.

What is the best way to run local Node.js binaries without installing packages globally?

Use npx or npm exec to run local Node.js binaries temporarily without global installs. This resolves local project binaries first and executes packages on demand for clean, isolated command execution.

Can I compose npm scripts to run in sequence or parallel for CI workflows?

You can compose npm script pipelines to run tasks in sequence or parallel. This allows you to automate CI steps that run lint, typecheck, and tests together with environment-specific flags.

Do I need Node and npm installed to use npx commands and execute package.json scripts?

Yes, executing npm scripts and npx commands requires Node and npm installed locally. The project also needs a package.json file with scripts defined to support argument forwarding and environment variable injection.

How can I ensure npm scripts run reliably across both Windows and Unix environments?

Use cross-platform composition tools within your npm scripts to improve Windows and Unix compatibility. This ensures script pipelines, argument forwarding, and environment variable injection execute reliably across different operating systems.