moducreate-jpz organizes feature files inside your existing layer folders.
It works with Express, MERN, Laravel, and LaraVue projects without forcing a new top-level modules folder.
Version 2.0.0 - Performance & Quality Enhancements:
- Performance Optimizations: Parallelized async file system operations for faster project detection and file scanning
- Stricter TypeScript: Enhanced type safety with
noUncheckedIndexedAccess,noUnusedLocals, and other strict compiler options - Better Logging: Added timestamps and improved log levels with visual indicators for better debugging
- Input Validation: Added comprehensive configuration validation to catch errors early with clear error messages
- Memoization Utility: Created a memoization system for caching expensive operations (available for future use)
- Code Quality: Removed unused code, improved error handling, and fixed TypeScript type issues
- Detects your project type automatically.
- Scans existing files and groups them by module (default behavior).
- Moves matched files into feature subfolders inside current layer folders.
- Previews import and namespace path updates during dry runs.
- Updates relative and configured alias imports after files are moved.
- Updates Laravel PHP namespaces and
usestatements after PHP classes are moved. - Removes empty legacy
modulesorfeaturesfolders after successful moves. - Keeps your existing project layout.
Before:
backend/src/controllers/health.controller.ts
backend/src/services/health.service.ts
frontend/src/components/HealthStatus.tsx
After:
backend/src/controllers/health/health.controller.ts
backend/src/services/health/health.service.ts
frontend/src/components/health/HealthStatus.tsx
Run a safe preview first:
npx moducreate-jpz --dry-runUse CI-friendly check mode:
npx moducreate-jpz --checkApply changes:
npx moducreate-jpzCreate folders manually for selected modules:
npx moducreate-jpz --type express --modules auth,userSample projects live under templates/<stack>.
before: flat/mixed project files with multiple modules and import callers.after: expected structure after runningnpx moducreate-jpz.
Copy a before folder to a temporary location before running the CLI so the original sample stays unchanged.
npx moducreate-jpz
npx moducreate-jpz --dry-run
npx moducreate-jpz --check
npx moducreate-jpz --copy-existing
npx moducreate-jpz --type mern --dry-run
npx moducreate-jpz --type laravel --modules auth,user-t, --type <type>: Set project type (express,mern,laravel,laravue) when auto-detection is not correct.-m, --modules <list>: Create module folders manually using comma-separated names likeauth,user,booking.--check: Preview changes and exit with code1when modularization is still needed.--dry-run: Show the full preview without writing files.--copy-existing: Copy existing matched files into module folders instead of moving.--move-existing: Move existing matched files into module folders (default).--folders-only: Create only folders, without starter files.--force: Overwrite existing target files.
- Express API
- MERN (
client/serverorfrontend/backendlayouts) - Laravel
- LaraVue
- A preview is shown before writing changes, including import and namespace updates.
- Move operations run automatically after the preview unless you use
--dry-runor--check. - Relative JavaScript, TypeScript, Vue imports, and common
tsconfig/jsconfig/Vite aliases are updated after moved files land in their new folders. - Laravel PHP namespaces and
usestatements are updated when classes move under module folders. - Existing target files are skipped unless
--forceis used. - Dry run mode makes no file changes.
npm install
npm test
npm run build
npm run dev -- --dry-run --type express --modules auth,user