rcq-folder-factory
v1.0.3
Published
A command-line utility to create folders with a predefined structure for RCQ.
Downloads
6
Readme
RCQ Folder Generator
This script automates the creation of a new folder with predefined files for your RCQ (Route-Controller-Query) structure in a Node.js project.
Features
- Creates a new folder within the
src/RCQ
directory - Generates three files:
Query.js
,Controller.js
, andRouter.js
- Automatically populates these files with boilerplate code
- Ensures the
src/RCQ
parent directory exists
Prerequisites
- Node.js installed on your system
- Access to the command line
Installation
- Clone this repository or download the script file.
git clone https://github.com/ibrataha8/rcq-folder-factory
- Navigate to the directory containing the script.
cd rcq-folder-factory
- Install Dependencies:
npm install
Usage RCQ By NPM
- Install the package globally:
npm i -g rcq-folder-factory
- Create a new RCQ folder:
npx rcq-folder-factory --namefolder=NewFolder
- Result
The script will create the following structure:
src/
└── RCQ/
└── NewFolder/
├── Query.js
├── Controller.js
└── Router.js
Generated Files
- Query.js
- Contains a basic query to select all items from a table named after your folder.
- Controller.js
- Sets up a controller function to handle GET requests for all items.
- Router.js
- Configures an Express router with a GET route for the new resource.
Customization
- You can modify the script to change the content of the generated files or add more files as needed.
Contributing
- Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.
Contact
- For any questions or feedback, please contact [email protected].