initial-node v1.0.2
Initial-Node
initial-node
is a CLI tool for initializing a well-structured Node.js project with predefined directories, files, and configurations. It helps developers set up a standard project structure quickly, saving time and ensuring consistency.
Features
- Automatically creates commonly used directories and files for a Node.js project.
- Generates a
.gitignore
file. - Creates a
package.json
if it doesn’t exist. - Initializes a git repository.
- Installs essential dependencies (
express
,dotenv
,node-cache
,body-parser
, andcors
).
Project Structure
The tool generates the following directory and file structure:
src/
├── controllers/
├── models/
├── routes/
├── services/
├── middleware/
├── config/
├── utils/
└── app.js
.env
.gitignore
package.json (if not already created)
Installation
To install the CLI globally:
npm install -g initial-node
if you get the error please try:
sudo npm install -g initial-node
Usage
Run the following command in the root of your desired project directory:
create-node-js
This will create the project structure, initialize Git, and set up essential files.
Example
Navigate to your desired directory:
cd my-new-project
Run the tool:
create-node-js
After execution, you’ll see the following:
- Predefined directories and files created.
.gitignore
added.package.json
initialized and dependencies installed.
Start building your application!
Requirements
- Node.js (>=12.0.0)
- npm (>=6.0.0)
Contributing
Contributions are welcome! If you'd like to improve this package:
- Fork the repository: initial-node-js
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add new feature'
- Push to the branch:
git push origin feature-name
- Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.