SCOPE is an explainable npm dependency scanner that flags risky packages in the CLI, web UI, and GitHub Actions.
Backend API hosted on HuggingFace Spaces.
- You scan a package or
package.json. - SCOPE reads public npm and GitHub data about that package.
- It turns that data into a small set of risk signals.
- A trained model scores the package from 0 to 1.
- The explanation layer shows why the score is high or low.
git clone https://github.com/reiabaid/npm.git
cd npm
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .
uvicorn src.api.main:app --reloadFrontend:
cd frontend
npm install
npm run devscope check lodash
scope check react-domm
scope batch package.json --json --fail-on-high--fail-on-high exits with code 1 when any package score is above 0.80.
Use .github/workflows/scope.yml in a repo with npm dependencies. It runs on pull requests that change package.json or package-lock.json, posts a PR comment, and fails the check if a package is too risky.
- F1 score, suspicious class:
0.88 - ROC-AUC:
0.9886
- CLI scanning for single packages or project files
- React web UI for interactive scoring
- GitHub Action for PR blocking
- SHAP-style explanations for each score
- npm and GitHub metadata enrichment
- Python, FastAPI, Uvicorn
- scikit-learn, Random Forest, SMOTE, SHAP
- React, Vite
- GitHub Actions
- Set
VITE_API_BASEif the frontend points to a deployed backend.