gsharpi v2.0.1
π― gsharpi : Automatic Package Installer ( React + vite )
gsharpi-plugin is a Vite plugin that revolutionizes your workflow by automatically detecting and installing missing npm packages. Say goodbye to the tedious task of manually managing your dependenciesβlet gsharpi-plugin handle it for you, in real-time, while you code!
π₯ Installation
To get started with gsharpi-plugin, follow these steps:
Install Dependencies:
npm installIntegrate Plugin in your
vite.config.js:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { gsharpi } from 'gsharpi'
export default defineConfig({
plugins: [react(), gsharpi()],
})3. **Run Your Vite Server**:
```bash
npm run devThe plugin will now watch your files and automatically install any missing npm packages it detects!
π οΈ Usage
Once set up, gsharpi-plugin works behind the scenes. Here's an example:
Example Code
import React from 'react';
import axios from 'axios';
import AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart';
import _ from 'lodash/fp';Upon saving your file, the plugin will automatically install:
reactaxios@mui/icons-materiallodash
Folder Structure
Ensure your project structure looks like this:
project-root/
βββ src/
β βββ App.js or App.jsx
β βββ other files
βββ package.json
βββ vite.config.js
βββ node_modules/π How It Works
- File Watching: Uses
chokidarto monitor changes in yoursrc/folder. - Import Detection: Scans files with regex for
importandrequirestatements. - Automatic Installation: Installs missing dependencies using
npm installautomatically.
π§ Commands
npm run dev: Starts the Vite development server and automatically watches for missing packages.npm install <package-name>: Manually install a package if needed.
π Requirements
- Node.js: v14 or later
- npm: v6 or later
- Vite: v5 or later
π Future Enhancements
We have some exciting plans for gsharpi-plugin:
- π Support for
pnpmandyarnpackage managers. - π Ability to monitor additional directories.
- π οΈ Enhanced error handling and reporting for failed installations.
π‘ Why gsharpi-plugin?
Whether you're an experienced developer or just starting out, gsharpi-plugin is designed to save you time by automating mundane tasks, keeping you focused on writing great code.
π License
This project is licensed under the Apache-2.0 License.
π¬ Stay in Touch
Weβd love to hear from you! Feel free to contribute, ask questions, or suggest improvements!
With gsharpi-plugin, automating package installations becomes a seamless part of your workflow. Enjoy coding while we handle the rest! π
This enhanced README has a clean and appealing structure, highlights key features, and provides a good balance of technical information and visual appeal. Feel free to customize it further to match your project!
π¬ Author
MR GAURI SHANKAR KHADGA
β€οΈ KEEP CODING β€οΈ