1.0.0 • Published 5 months ago

saksh-pc2 v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

šŸ“¦ saksh-pc2 - Node.js Package Checker

saksh-pc2 is a lightweight CLI tool that scans a JavaScript file to detect external dependencies (require() and import statements). It then suggests an npm install command to install missing packages.


šŸš€ Installation

To install saksh-pc2 globally, run:

npm install -g saksh-pc2

After installation, you can use the saksh-pc2 command from anywhere in your terminal.


šŸ› ļø Usage

1ļøāƒ£ Check External Dependencies

To check which external packages are used in a JavaScript file, run:

saksh-pc2 app.js

2ļøāƒ£ Example Output

If your file app.js contains:

const express = require("express");
const mongoose = require("mongoose");

console.log("Server running...");

Running saksh-pc2 app.js will output:

šŸ“¦ Detected external packages:

express
mongoose

šŸ’” To install them, run:

npm install express mongoose

If no external packages are found:

āœ… No external packages detected.

āš™ļø Features

āœ… Scans JavaScript files for dependencies
āœ… Supports both require() (CommonJS) and import (ES Modules)
āœ… Generates an npm install command
āœ… Fast and lightweight
āœ… No dependencies on large libraries


šŸ’” Why Use saksh-pc2?

  • Quickly check for missing dependencies before running your script.
  • Prevent Module Not Found errors in production.
  • Ensure all required packages are installed before deployment.
  • Simple and fast, with minimal dependencies.

šŸ”§ Advanced Usage

If you want to automatically install missing dependencies, you can modify the command:

saksh-pc2 app.js | xargs npm install

This will scan for missing packages and install them automatically.


šŸ—ļø Contributing

If you find a bug or have suggestions, feel free to open an issue or submit a pull request.


šŸ“œ License

MIT License.


Happy coding! šŸš€

1.0.0

5 months ago