- Notifications
You must be signed in to change notification settings - Fork0
A CLI tool for generating Next.js, Express.js, and Vite React project templates
License
sujit-shrc/pzr
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Note
Supercharge your web development workflow with pzr - the CLI based templates generator tool for Next.js, Express.js, and Vite React projects!
pzr simplifies the process of creating new pages, routes, and components, allowing developers to focus on writing business logic rather than boilerplate code.
- 🔮Smart Project Config Detection: Automatically identifies your project type and configuration
- ⚡Lightning-Fast Setup: Initialize new projects or add pzr to existing ones with a single command
- 🏗️Effortless Scaffolding: Generate pages, routes, and components tailored to your project structure
- 🔧Flexible and Customizable: Easily adjust detected settings to match your specific needs
- 🌟Framework Agnostic: Supports Next.js, Express.js, and Vite React out of the box
Whether you're a seasoned developer or just starting out, pzr helps you focus on what matters most - writing great code and building amazing applications!
Installpzr
globally usingnpm
oryarn
:
npm install -g pzr# oryarn global add pzr
Tip
Global installation allows you to usepzr
from any directory on your system.
To initialize a new project or configure pzr for an existing project:
pzr init
This command will:
- 🔍 Automatically detect your project type and configuration
- 🖥️ Display the detected settings
- ✅ Prompt you to confirm or modify these settings
Create new pages, routes, or components using thecreate
command or its shorthand-c
:
pzr create [pages...]# orpzr -c [pages...]
Create multiple pages:
pzr create home about contact# orpzr -c home about contact
Generate files in a specific directory:
pzr create -d dashboard/settings profile# orpzr -c -d dashboard/settings profile
Tip
You can create multiple pages/routes at once by listing them after thecreate
command or-c
flag.
If you prefer not to installpzr
globally, use it on a per-project basis:
Install as a dev dependency:
npm install --save-dev pzr# oryarn add --dev pzr
Run
pzr
commands usingnpx
:npx pzr initnpx pzr -c home about
Alternatively, add scripts to your
package.json
:{"scripts": {"pzr:init":"pzr init","pzr:create":"pzr -c" }}
Then use
npm
or yarn to run the commands:npm run pzr:initnpm run pzr:create home about# or with yarnyarn pzr:inityarn pzr:create home about
Usepzr
without installation via npx:
npx pzr initnpx pzr -c home aboutnpx pzr -c -d dashboard/settings profile
Warning
Usingnpx
without installation may result in slower execution times as it downloads the package each time.
pzr
intelligently detects:
- Project Type: Next.js, Express.js, or Vite React
- Language: TypeScript or JavaScript
- Source Directory: Whether you're using a
src
directory - Next.js Routing: Page Router or App Router (for Next.js projects)
After detection,pzr
will display the detected settings and prompt you to confirm or customize them, ensuring accuracy and flexibility.
pzr
file generation based on the project type:
Next.js:
- Generates
layout.tsx
,page.tsx
, andloader.tsx
in created routes in/app
or/src/app
dir. - Supports both Page Router and App Router structures and both
tsx
andjsx
components.
- Generates
Express.js:
- Creates models, controllers, and routes for
js
orts
apps. - Automatically adds
app.use(routeMiddleware)
inapp.ts
- Creates models, controllers, and routes for
Vite React:
- Generates
.jsx
or.tsx
components in the/components
directory
- Generates
Important
We're actively working on adding support for more project types!
pzr stores its configuration in a.pzr-config.json
file in your project root. This file is created when you runpzr init
and contains information about your project type, language preference, and other settings.
Caution
It's recommended to use thepzr init
command to modify your configuration. Manual edits to.pzr-config.json
may lead to unexpected behavior.
For bug reports and feature requests, please open an issue on ourGitHub repository.
Important
🤝 We welcome contributions! Feel free to submit pull requests to help improve pzr.
pzr
is released under the MIT License. See the LICENSE file for more details.
About
A CLI tool for generating Next.js, Express.js, and Vite React project templates