Initialize Project in NPM
From the NPM Package Manager cheat sheet ยท Project Setup & Initialization ยท verified Jul 2026
Initialize Project
Create a new package.json file
bash
# Interactive setup
npm init
# Quick setup with defaults
npm init -y
# Create with scope
npm init --scope=@mycompany
# Use create- starter
npm init react-app my-app
npm init vite@latest my-project
# Common init options
npm init -w packages/new-package # In workspace
npm init --workspace=packages/api๐ข Essential - Every project starts with npm init
๐ก Use -y flag to skip questions and use defaults
๐ npm init <pkg> runs npm exec create-<pkg>
โก Set config defaults to save time
๐ Related: npm config for default settings
initsetup