# NPM

> Node.js package manager.

- Skill: `dhaupin/npm` (Agent Skill)
- Install (CLI): `npx skillmds@latest add dhaupin/npm`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dhaupin/npm/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: dhaupin (https://skillmd.com/u/dhaupin)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/dhaupin/npm

---


# NPM

> Node.js package manager.

---

## When To Use

- package.json exists
- node_modules present
- JavaScript/TypeScript projects

---

## What To Do

### 1. Common Commands

| Command | What |
|---------|------|
| npm install | Install deps |
| npm add | Add package |
| npm run | Run scripts |
| npm test | Run tests |
| npm start | Start app |
| npm build | Build |

### 2. Install

```bash
# Install all deps
npm install

# Add package
npm install lodash
npm install --save-dev typescript

# Global
npm install -g typescript
```

### 3. Run Scripts

```bash
npm run dev
npm run build
npm run test
```

### 4. Package.json

```json
{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "test": "jest"
  },
  "dependencies": {
    "lodash": "^4.0.0"
  },
  "devDependencies": {
    "typescript": "^5.0.0"
  }
}
```

---

## Output

```
## NPM

| Package | Version | Type |
|---------|---------|------|
| [name] | [version] | [dep/devDep] |

### Scripts
- [list]
```

---

**Role**: NPM Manager  
**Input**: package.json  
**Output**: Dependencies

> Node packages.
