πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

@cyberhub/pkgtrust

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cyberhub/pkgtrust

Trust scoring for npm packages β€” maintainer risk, package health, and supply chain signals

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
14
-56.25%
Maintainers
1
Weekly downloads
Β 
Created
Source

pkgtrust

Trust scoring for npm packages β€” maintainer risk, package health, and supply chain signals.

Before you npm install, know what you're getting into.

# Install globally (recommended)
npm install -g @cyberhub/pkgtrust
pkgtrust scan express

# Or use via npx
npx --package=@cyberhub/pkgtrust pkgtrust scan express
  express@4.21.0
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 82/100 A TRUSTED
  Confidence: high

  Breakdown:
    Maintainer Trust:  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 88
    Package Health:    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 78
    Supply Chain:      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 95
    Community:         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘ 72

  Flags:
    MEDIUM   30 direct dependencies
    LOW      No provenance attestation on latest version
    INFO     Published with 2FA enabled (signed)

Install

# Install globally (recommended)
npm install -g @cyberhub/pkgtrust

# Then use from anywhere
pkgtrust scan lodash
pkgtrust compare axios got node-fetch
pkgtrust maintainer sindresorhus

# Or use via npx (no install needed)
npx --package=@cyberhub/pkgtrust pkgtrust scan lodash

Commands

Scan a package

pkgtrust scan express
pkgtrust scan @anthropic-ai/sdk
pkgtrust scan react --json

Scan your project

Scans all dependencies in package.json:

pkgtrust scan

Compare packages

pkgtrust compare axios got node-fetch

Output:

  Metric               axios        got          node-fetch
  ─────────────────── ──────────── ──────────── ────────────
  Trust Score          78           82           85
  Grade                B+           A            A
  Maintainer Trust     75           80           90
  Package Health       80           85           82
  Supply Chain         85           90           95
  Flags                3            2            1

  Winner: node-fetch

Maintainer lookup

pkgtrust maintainer sindresorhus

CI gate

Fail the build if any dependency scores below threshold:

pkgtrust gate --min-score=50

Exit code 0 = pass, 1 = fail. Use in CI:

- run: npx @cyberhub/pkgtrust gate --min-score=50

JSON output

pkgtrust scan express --json
pkgtrust scan --json > trust-report.json

Scoring Methodology

Each package gets a composite trust score (0-100) from four categories:

CategoryWeightWhat it measures
Maintainer Trust40%Account age, publication record, maintainer changes, multi-maintainer, publish cadence, email domain, 2FA
Package Health30%Install scripts, dependency count, license, provenance, size changes, binary detection, deprecation
Supply Chain20%Typosquatting risk, known compromises, source-registry consistency
Community10%GitHub stars, contributors, commit recency, CI, downloads

Grades

GradeScoreTier
A+95-100Trusted
A85-94Trusted
B+75-84Standard
B65-74Standard
C+55-64Caution
C45-54Caution
D30-44Caution
F0-29Avoid

Confidence

Shows how many data signals were available:

  • High β€” 70%+ of signals available (npm metadata + GitHub + downloads)
  • Medium β€” 40-69% signals
  • Low β€” <40% signals (score less reliable)

Known Compromise Database

pkgtrust cross-references against historically compromised packages:

PackageIncident
event-streamMalicious flatmap-stream injection (2018)
ua-parser-jsCryptominer in v0.7.29/0.8.0/1.0.0 (2021)
colorsMaintainer sabotaged with infinite loop (2022)
fakerMaintainer deleted all code (2022)
node-ipcProtestware targeting Russian IPs (2022)
@ledgerhq/connect-kitWallet drainer injection (2023)

Programmatic API

import { scanPackage, scanProject, comparePackages } from '@cyberhub/pkgtrust';

// Score a single package
const score = await scanPackage('express');
console.log(score.score, score.grade, score.tier);

// Scan project dependencies
const result = await scanProject('./my-project');
console.log(result.summary.averageScore);

// Compare alternatives
const comparison = await comparePackages(['axios', 'got', 'node-fetch']);
console.log(comparison.winner);

Options

FlagDescription
--jsonOutput as JSON
--min-score=NGate threshold (default: 50)
--syncSync scores to nrupak.com for trending

How it works

  • Fetches package metadata from registry.npmjs.org
  • Queries 8 security databases in parallel (GitHub Advisories, OSV.dev, npm audit, Snyk, Socket.dev, npms.io, Bundlephobia, deps.dev)
  • Fetches GitHub repo health and OpenSSF Scorecard
  • Scores across 18+ signals in 4 categories with live CVE data
  • Applies transitive risk β€” if your dependency depends on a breached package, you get flagged
  • Applies maintainer cross-reference β€” if a maintainer has compromised history, all their packages get flagged
  • Produces composite score with letter grade and risk tier
  • Stores results locally + optionally syncs to nrupak.com dashboard

Features

  • 8 Security Databases: GitHub Advisories, OSV.dev, npm audit, Snyk, Socket.dev, npms.io, Bundlephobia, deps.dev
  • Transitive Risk: Flags packages that depend on breached dependencies
  • Maintainer Cross-Reference: Flags packages by compromised maintainers
  • Package Compare: pkgtrust compare axios got node-fetch
  • CI Gate: pkgtrust gate --min-score=50 fails builds below threshold
  • Dependency Tree: Visualizes full dep chain with vuln indicators
  • GitHub PR Bot: Auto-comments trust scores on PRs with dependency changes
  • Leaderboard: Top packages ranked by trust at nrupak.com/trust/leaderboard
  • Verified Maintainers: Maintainers can claim and verify their profiles

Dashboard

Public trust scores at nrupak.com/trust:

  • Search: Look up any npm package or maintainer
  • Browse: Filter all scored packages by tier, sort by score/date
  • Compare: Side-by-side comparison at /trust/compare
  • Leaderboard: Top packages ranked at /trust/leaderboard
  • Maintainer Profiles: OSINT view with GitHub data, packages, verified badges
  • GitHub PR Bot: Setup at /trust/github-app

Zero Dependencies

pkgtrust has zero runtime dependencies. Built with only Node.js built-in fetch API.

License

MIT β€” Nrupak Shah

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts