npm to Yarn / pnpm / Bun Converter
Convert npm commands to their Yarn, pnpm, or Bun equivalents — paste one command per line
About this ToolHow it works, benefits & use casesTap to collapse
Switching package managers means rewriting every install line in your README, CI config, and contribution docs — this converter does it for you. Paste npm commands one per line and it rewrites them to the Yarn, pnpm, or Bun equivalent: install becomes yarn/pnpm install or bun install, npm install pkg becomes yarn add / pnpm add / bun add, the -D and -g flags are mapped to each tool's syntax, npm ci becomes a frozen-lockfile install, npm run build becomes yarn build or bun run build, and npx is rewritten to yarn dlx, pnpm dlx, or bunx. Blank lines and unknown commands pass through untouched, so you can convert a whole script block at once. Pick the target manager with a single click, drop in your commands, and copy the result. Everything runs in your browser — nothing is uploaded.
How to Use
- 1Pick your target package manager — Yarn, pnpm, or Bun — from the buttons at the top.
- 2Paste your npm commands into the input box, one command per line, or click a quick-example chip to load a sample.
- 3Click "Convert to Yarn/pnpm/Bun" to rewrite every line into the chosen manager's syntax.
- 4Review the converted commands in the output panel; blank lines and anything not recognised as npm are kept as-is.
- 5Copy the result, download it as a text file, or pipe it into another tool.
Key Benefits
- Converts to three managers — Yarn, pnpm, and Bun — from one npm source
- Handles install, add, remove, update, run scripts, ci, init, and npx in a single pass
- Maps the -D (dev) and -g (global) flags to each manager's correct form
- Rewrites npm ci to the frozen-lockfile install for reproducible installs
- Converts npx to yarn dlx, pnpm dlx, or bunx automatically
- Processes multiple commands at once — one per line — for whole script blocks
- A built-in quick-reference table shows the npm-to-everything mapping
Common Use Cases
- Rewriting install instructions in a README when a project switches managers
- Porting CI/CD pipeline steps from npm to pnpm or Bun
- Translating a teammate's npm snippet into the manager your repo actually uses
- Updating contribution docs so commands match the committed lockfile
- Learning the equivalent syntax across Yarn, pnpm, and Bun side by side
Target package manager
Quick examples:
One command per line
Converted Yarn commands will appear here.
Quick reference
npm
- npm install
- npm install pkg
- npm install -D pkg
- npm run build
- npx command
Yarn
- yarn
- yarn add pkg
- yarn add --dev pkg
- yarn build
- yarn dlx command
pnpm / Bun
- pnpm install / bun install
- pnpm add pkg / bun add pkg
- pnpm add -D pkg / bun add -d pkg
- pnpm build / bun run build
- pnpm dlx cmd / bunx cmd
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Color ConverterConvert between HEX, RGB, HSL, and HSV
- cURL to Code ConverterConvert cURL commands to code in various languages
- HTML to MarkdownConvert HTML to Markdown
- JSON to CSVConvert JSON to CSV format
- Postman to cURL ConverterConvert Postman requests to cURL commands
- Text to HexConvert text to hexadecimal
You can target Yarn, pnpm, or Bun. Select one with the buttons at the top and the same npm input is rewritten into that manager's syntax — for example npm install lodash becomes yarn add lodash, pnpm add lodash, or bun add lodash depending on your choice.
Yes. npm install --save-dev (or -D) maps to yarn add --dev, pnpm add -D, and bun add -d, while npm install -g maps to the global add form for each manager. The converter recognises both the long and short flag spellings.

