What you’ll learn
By the end of this guide, you’ll know how to:- Identify packages that belong together
- Structure preset JSON correctly
- Handle interactive and non-interactive packages
- Add version pinning and custom flags
- Test and refine your presets
Identify packages you install together
Look at your recent projects and identify packages you repeatedly install as a group.For example, if you always set up Vite + React projects with the same dependencies, that’s a good candidate for a preset.Common groups:
- Frontend frameworks (React + Vite + plugins)
- Backend APIs (Express + TypeScript + middleware)
- Testing setup (Vitest + Testing Library)
- Animation libraries (GSAP + Three.js)
Choose your package manager
Pick the package manager you use most often. PM-Auto supports:
npm- Node Package Manager (default)pnpm- Fast, disk-efficient package manageryarn- Classic alternative to npmbun- Fast all-in-one JavaScript runtime
Structure your preset JSON
Create a JSON object with the basic preset structure:Key fields:
config.json
presetName- Used inpm-auto install <name>(match the key)description- Shows up inpm-auto list --descpackageManager- Which package manager to usepackages- Array of packages to install (we’ll fill this next)
Add packages to your preset
Now add each package or group of packages to the For dev dependencies:For interactive commands (like
packages array.For simple packages:create-react-app, create-next-app):Add version pinning and flags
Lock specific versions or add custom flags when needed.Pin a specific version:Add custom flags:Combine multiple options:
Test your preset
Before using your preset on a real project, test it:1. Validate the JSON syntax:2. Register your config:3. Dry run to preview commands:Review the commands that will be executed. Look for:Verify all packages installed correctly and your
- Correct package manager (npm vs pnpm vs yarn vs bun)
- Proper dev flags (-D or -d)
- Version strings (@version)
- Custom flags you added
package.json looks right.Complete example
Here’s a complete preset for a Vite + React + TypeScript project:config.json
Tips for creating great presets
Keep presets focused
Keep presets focused
Each preset should represent one type of project or workflow. Don’t try to make one preset that handles everything.Good:
Bad:
vite-react, next-app, express-apiBad:
everything-i-might-needUse clear, short names
Use clear, short names
Preset names should be easy to type and remember.Good:
Bad:
next, vite, threeBad:
next-js-with-typescript-and-tailwind-setupOrder packages logically
Order packages logically
Put interactive commands first if you have them, then group related packages together.
Document with descriptions
Document with descriptions
Always include a description so you remember what each preset is for:
What’s next?
Now that you know how to create presets:See examples
Browse real-world preset examples for inspiration
Config schema
View the complete configuration reference