Gathering detailed insights and metrics for my-boilerplate-generator
Gathering detailed insights and metrics for my-boilerplate-generator
Gathering detailed insights and metrics for my-boilerplate-generator
Gathering detailed insights and metrics for my-boilerplate-generator
npm install my-boilerplate-generator
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
27 Commits
4 Forks
2 Branches
3 Contributors
Updated on Jul 13, 2025
Latest Version
2.4.2
Package Id
my-boilerplate-generator@2.4.2
Unpacked Size
71.54 kB
Size
18.85 kB
File Count
47
NPM Version
10.9.1
Node Version
20.12.0
Published on
Jul 13, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A powerful CLI tool to generate boilerplate code for your existing projects. This tool helps you quickly scaffold common patterns and structures without manually creating all the boilerplate code.
boilerplate-cli/
├── src/
│ ├── index.js
│ ├── boilerplates/
│ │ ├── redux/
│ │ │ ├── redux.js # Redux generator
│ │ │ └── ...template files...
│ │ ├── api/
│ │ │ ├── api.js # API generator
│ │ │ └── ...template files...
│ │ ├── auth/
│ │ │ ├── auth.js # Auth generator
│ │ │ └── ...template files...
│ │ └── form/
│ │ ├── form.js # Form generator
│ │ └── ...template files...
│ ├── boilerplatesReactNative/
│ │ ├── assets/
│ │ │ ├── assets.js # RN assets generator
│ │ │ └── ...template files...
│ │ ├── navigation/
│ │ │ ├── navigation.js # RN navigation generator
│ │ │ └── ...template files...
│ │ ├── redux/
│ │ │ ├── redux.js # RN redux generator
│ │ │ └── ...template files...
│ │ └── services/
│ │ ├── services.js # RN services generator
│ │ └── ...template files...
│ ├── utils/
│ │ ├── colors.js
│ │ ├── installPackages.js
│ │ └── fileUtils.js
│ └── templates/ # (Optional: for shared or future templates)
├── package.json
└── README.md
1npm install my-boilerplate-generator
1npx my-boilerplate-generator <path> <template> [options]
1# Generate Redux boilerplate for a user entity 2npx my-boilerplate-generator ./src redux user 3 4# Generate API boilerplate for products 5npx my-boilerplate-generator ./api api products 6 7# generate multiple boiler plates for react-native(navigation + assets + services + redux) 8npx my-boilerplate-generator ./api react-native 9 10# Generate authentication system 11npx my-boilerplate-generator ./src auth 12 13# Generate form components for contact form 14npx my-boilerplate-generator ./components form contact
Generates Redux Toolkit setup with slices, actions, selectors, and store configuration.
Files Created:
store/slices/{entity}Slice.js
- Redux slice with reducersstore/actions/{entity}Actions.js
- Action creators with TODO comments for API callsstore/selectors/{entity}Selectors.js
- Selectors for state accessstore/index.js
- Store configurationDependencies:
@reduxjs/toolkit
react-redux
What You Get:
Generates API service layer with hooks, types, and utilities.
Files Created:
api/{entity}Api.js
api/client.js
api/endpoints.js
hooks/use{Entity}Api.js
types/{entity}Types.js
utils/apiUtils.js
Dependencies:
axios
Generates complete authentication system with context, providers, and components.
Files Created:
auth/AuthContext.js
auth/AuthProvider.jsx
auth/authService.js
hooks/useAuth.js
components/Auth/LoginForm.jsx
components/Auth/ProtectedRoute.jsx
utils/tokenUtils.js
constants/authConstants.js
1npx my-boiler-generate
Contributing a new boilerplate is now simpler than ever with our new folder-based structure.
Create a Folder: Inside src/boilerplates/
(for web) or src/boilerplatesReactNative/
(for React Native), create a new folder for your template (e.g., hooks/
).
Add Template Files: Place all the files for your boilerplate directly inside this new folder (e.g., hooks/useCustomHook.js
, hooks/useDebounce.js
).
Create the Generator File: Inside the same folder, create a generator file (e.g., hooks/hooks.js
). This file will contain the logic to copy the template.
Implement the Generator Class: Use the structure from the example below. The key parts are:
getDependencies()
method to list any required npm packages.async generate{TemplateName}Boilerplate()
method that:
copyBoilerplateFolder
to copy the entire directory.Register the Template: Import and register your new boilerplate generator in src/index.js
.
Here's what a new hooks
boilerplate generator would look like.
File Location: src/boilerplates/hooks/hooks.js
1const path = require('path'); 2const { copyBoilerplateFolder, walkSync } = require('../../utils/fileUtils'); 3 4class HooksBoilerplate { 5 // 1. Define static dependencies 6 static getDependencies() { 7 return []; // e.g., ['lodash.debounce'] 8 } 9 10 // 2. Implement the generator method 11 async generateHooksBoilerplate(projectPath, options) { 12 const templateDir = __dirname; // The current folder 13 14 // 3. Copy the entire folder, ignoring the generator file 15 await copyBoilerplateFolder(templateDir, path.join(projectPath, 'hooks'), ['hooks.js']); 16 17 // 4. List the files that were copied 18 const allFiles = walkSync(templateDir).filter(f => f !== 'hooks.js'); 19 20 return { 21 dependencies: HooksBoilerplate.getDependencies(), 22 instructions: ['Import and use the generated hooks in your components.'], 23 files: allFiles 24 }; 25 } 26} 27 28module.exports = HooksBoilerplate;
This CLI supports generating boilerplate code for new templates using Google Gemini AI. If you request a template that does not exist in the built-in list, you will be prompted to use the AI feature. The AI will generate the minimal, standard boilerplate for the requested type and create new files and folders as needed.
Important:
If you encounter any issues or have questions, please open an issue on GitHub.
No vulnerabilities found.
No security vulnerabilities found.