A powerful CLI tool to scaffold components or utility files with templates and maintain consistent exports across JavaScript/TypeScript projects.
- 🚀 Scaffold components/utilities with a single command
- 📂 Supports batch file creation using shorthand like
[Comp1,Comp2]
- 📦 Automatically updates or creates
index.js
for streamlined exports - 🎯 Supports React-style templates and named exports
- 🧪 Dry-run mode for previewing actions
- 🧠 Intelligent resolution of alias paths via
tsconfig.json
/jsconfig.json
npm install -g dev-add
dev add <filePath> [options]
dev add src/components/[Header,Footer] --template react-component --ext tsx
This will:
-
Create
Header.tsx
andFooter.tsx
insidesrc/components
-
Insert default React component templates
-
Update or create
index.js
in the same directory
Option | Description |
---|---|
--ext |
File extension (e.g., tsx , js , default: tsx ) |
--template |
Template type (e.g., react-component ) |
--named |
Use named exports instead of default |
--dry |
Run without writing files (simulation only) |
--verbose |
Print detailed logs |
--nocomp |
Skip updating or creating index.js
|
-
React Component (
--template react-component
)const ComponentName = () => { return <div>ComponentName</div>; }; export default ComponentName;
-
With
--named
:export const ComponentName = () => { return null; };
If your project uses path aliases in tsconfig.json
or jsconfig.json
(e.g., @components/*
), the CLI internally resolves it for correct file generation.
# Run locally
npm install
npm run dev add src/utils/[math,parser] --ext ts
-
Node.js ≥ 14.x
-
A valid
package.json
in the project root
Licensed under the MIT License.
Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a PR.
-
Custom template support
-
Plugin architecture
-
In-place file updating
If you find this project useful, please consider starring it on GitHub ⭐