A powerful CLI tool to quickly scaffold various JavaScript and TypeScript project structures with best practices and modern tooling.
js-project-generator
is a command-line tool that helps you create new JavaScript and TypeScript projects instantly. Instead of manually setting up project structures, installing dependencies, and configuring tools like ESLint, Prettier, and testing frameworks, this CLI does it all for you with a single command.
- β‘ Save Time: Create fully configured projects in seconds
- π οΈ Zero Configuration: Everything is pre-configured and ready to run
- π Best Practices: Follows industry standards and conventions
- π¨ Modern Tooling: Includes ESLint, Prettier, Jest, and more
- π§ Multiple Frameworks: Support for 7 popular project types
- π± Cross-Platform: Works on Windows, macOS, and Linux
- Multiple Project Types: Support for 7 different project types
- Language Support: JavaScript and TypeScript options (where applicable)
- Modern Tooling: Pre-configured with ESLint, Prettier, and testing frameworks
- Best Practices: Follows industry standards and conventions
- Zero Configuration: Ready-to-run projects out of the box
Project Type | JavaScript | TypeScript | Description |
---|---|---|---|
Node.js | β | β | Basic Node.js server application |
Express.js | β | β | Express.js MVC application |
Next.js | β | β | Full-stack React framework |
React | β | β | React application with Vite |
NestJS | β | β | Progressive Node.js framework |
Electron | β | β | Cross-platform desktop app |
React Native | β | β | Mobile app development |
npm install -g js-project-generator
npx js-project-generator@latest
The easiest way to get started is using the interactive mode:
js-project-generator
This will guide you through the process step by step, asking for:
- Project name (e.g.,
my-awesome-app
) - Project type (Node.js, Express, React, etc.)
- Language (JavaScript or TypeScript)
Then it creates your project with all the necessary files and configurations!
js-project-generator
This will prompt you for:
- Project name
- Project type
- Language (JavaScript/TypeScript)
If you prefer to specify everything in one command:
js-project-generator <project-name> --type <project-type> --language <language>
# Create an Express.js project with TypeScript
js-project-generator my-api --type express --language ts
# Create a React project with JavaScript
js-project-generator my-app --type react --language js
# Create a Next.js project (TypeScript only)
js-project-generator my-nextjs-app --type nextjs
# Create a NestJS project (TypeScript only)
js-project-generator my-nest-api --type nest
# Create an Electron app with TypeScript
js-project-generator my-desktop-app --type electron --language ts
# Create a React Native app
js-project-generator my-mobile-app --type react-native
project-name/
βββ src/
β βββ index.js
β βββ app.js
β βββ utils/
β βββ config/
βββ package.json
βββ .gitignore
βββ README.md
project-name/
βββ src/
β βββ controllers/
β βββ models/
β βββ routes/
β βββ middleware/
β βββ config/
β βββ utils/
β βββ app.js
βββ package.json
βββ .gitignore
βββ README.md
project-name/
βββ src/
β βββ app/
β β βββ layout.tsx
β β βββ page.tsx
β β βββ globals.css
β βββ components/
β βββ lib/
β βββ styles/
βββ public/
βββ next.config.js
βββ package.json
βββ tsconfig.json
βββ README.md
project-name/
βββ src/
β βββ components/
β βββ hooks/
β βββ utils/
β βββ styles/
β βββ App.tsx
β βββ main.tsx
βββ public/
βββ index.html
βββ vite.config.ts
βββ package.json
βββ tsconfig.json
βββ README.md
project-name/
βββ src/
β βββ controllers/
β βββ services/
β βββ modules/
β βββ dto/
β βββ entities/
β βββ config/
β βββ common/
βββ test/
βββ package.json
βββ tsconfig.json
βββ nest-cli.json
βββ README.md
project-name/
βββ src/
β βββ main/
β βββ renderer/
β βββ preload/
βββ public/
βββ build/
βββ package.json
βββ electron-builder.json
βββ README.md
project-name/
βββ src/
β βββ components/
β βββ screens/
β βββ navigation/
β βββ services/
β βββ utils/
β βββ assets/
βββ android/
βββ ios/
βββ App.js
βββ index.js
βββ metro.config.js
βββ babel.config.js
βββ package.json
βββ README.md
Each generated project comes with:
- π¦ Package.json with appropriate dependencies and scripts
- βοΈ TypeScript configuration (for TS projects)
- π ESLint and Prettier configuration for code quality
- π Git ignore file to exclude unnecessary files
- π Comprehensive README with setup instructions
- ποΈ Basic project structure following best practices
- π Development scripts (start, dev, build, test, lint)
- π§ͺ Testing setup with Jest (where applicable)
- π¨ Styling configuration (CSS, Tailwind, etc.)
- π± Platform-specific configs (for Electron, React Native)
js-project-generator my-api --type express --language ts
cd my-api
npm install
npm run dev
# Your API will be running at http://localhost:3000
js-project-generator my-react-app --type react --language ts
cd my-react-app
npm install
npm start
# Your React app will open at http://localhost:3000
js-project-generator my-nextjs-app --type nextjs
cd my-nextjs-app
npm install
npm run dev
# Your Next.js app will be running at http://localhost:3000
js-project-generator my-server --type nodejs --language js
cd my-server
npm install
npm start
# Your server will be running at http://localhost:3000
- Node.js 14.0.0 or later
- npm or yarn
git clone https://github.com/souravrooj/create-js-project.git
cd create-js-project
npm install
npm run build
If you just want to use the tool, simply install it globally:
npm install -g js-project-generator
npm run build
- Build the projectnpm run dev
- Run in development modenpm run start
- Run the built versionnpm run test
- Run testsnpm run lint
- Run ESLintnpm run format
- Format code with Prettier
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Commander.js for CLI framework
- Inquirer.js for interactive prompts
- fs-extra for file operations
If you encounter any issues or have questions:
- π Check the Issues page - Your question might already be answered
- π Create a new issue with detailed information about your problem
- π» Include your environment: Node.js version, operating system, and CLI command you used
- π§ Contact directly: Email souravrooj64@gmail.com for urgent issues
- "Command not found": Make sure you installed the package globally with
npm install -g js-project-generator
- "Permission denied": On Linux/Mac, you might need to use
sudo npm install -g js-project-generator
- "Project directory already exists": Choose a different project name or delete the existing directory
- Author: Sourav Rooj
- Email: souravrooj64@gmail.com
- Phone: +91 7001014799 (India)
- GitHub: @souravrooj
Happy coding! π