npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ghost-guard

v1.0.2

Published

A zero-trust dependency installer that protects developers from malicious npm packages during installation.

Readme

Ghost-Guard — Install any npm package with zero anxiety.

Ghost-Guard is a zero-trust dependency installer that protects developers from malicious npm packages during installation. It wraps npm install and runs it inside a sandbox that prevents malicious behavior from dependencies.

Features

  • CLI Tool: Use ghost install <package> instead of npm install <package> for secure installation.
  • Package Auditing: Analyze package security without installation using ghost audit <package>.
  • Dependency Scanning: Scan existing node_modules with ghost scan for security issues.
  • Colored Terminal Output: Professional CLI with color-coded messages and progress indicators.
  • Progress Logs: Real-time feedback during operations.
  • Postinstall Script Detection: Detects and warns about postinstall/preinstall/install scripts, with options to block execution.
  • Network Request Blocking: Blocks outbound HTTP/HTTPS requests during installation unless whitelisted.
  • Sensitive File Protection: Prevents dependencies from accessing sensitive files like .env, SSH keys, and config files.
  • Shell Execution Prevention: Blocks attempts to execute shell commands via child_process.
  • Filesystem Scan Detection: Detects recursive filesystem access patterns that may indicate scanning behavior.
  • Module Loading Guards: Prevents loading of dangerous Node.js modules during installation.
  • Dependency Behavior Analysis: Analyzes package dependencies for risky patterns and known vulnerabilities.
  • Risk Scoring System: Assigns risk scores to packages based on static analysis and runtime behavior.
  • Security Reports: Generates detailed security reports after installation with risk assessments.
  • Whitelist System: Configurable via ghost.config.json for network allows and script policies.
  • Sandbox Layer: Activates security guards before running npm install.
  • Logging: Logs all blocked actions for transparency.

Installation

npm install -g ghost-guard

Usage

Basic Installation

ghost install lodash

Audit a Package

ghost audit suspicious-package

Scan Existing Dependencies

ghost scan

Show Help

ghost help

Use Case

Imagine a developer onboarding a new project and wanting to install a dependency without giving it free reign to execute lifecycle scripts, reach out over the network, or scan local secrets. With Ghost-Guard, they can:

  1. Run ghost audit <package> to inspect package risk before installing.
  2. Run ghost install <package> to securely install the package with guards active.
  3. Use ghost scan to review the already-installed node_modules tree for risky packages.

This gives teams a safer package workflow that mirrors npm/yarn usability while adding a zero-trust protection layer.

Configuration

Create a ghost.config.json file in your project root:

{
  "allowNetwork": ["registry.npmjs.org"],
  "allowPostInstall": false
}
  • allowNetwork: Array of allowed domains for network requests.
  • allowPostInstall: Boolean to allow or block postinstall scripts.

Security Reports

After installation, Ghost-Guard generates a comprehensive security report:

GhostGuard Security Report
==========================
Package: example-lib
Risk Score: 6/10 (MEDIUM)

Static Analysis:
- Dependencies: 15
- Lifecycle Scripts: YES
- Risky Dependencies: shell-executor, fs-scanner

Runtime Behavior:
- Network Access Attempts: 2
- Shell Execution Attempts: 0
- Filesystem Scans: 1
- Sensitive File Access: 0

Risk Factors:
- Has lifecycle scripts
- Attempted network access
- Filesystem scanning detected

Recommendations:
- MEDIUM RISK: Monitor closely

How It Works

Ghost-Guard monkey-patches Node.js core modules like fs, http, https, child_process, fetch, and the module loader to intercept and block malicious actions. It analyzes package metadata before installation and monitors runtime behavior to detect suspicious activities. All patches are made immutable to prevent bypass attempts.

Security Features

  1. Network Guard: Blocks all outbound requests except whitelisted domains.
  2. File Guard: Prevents reading sensitive files and detects filesystem scanning.
  3. Shell Guard: Blocks shell command execution.
  4. Module Guard: Prevents loading dangerous modules.
  5. Script Guard: Detects and optionally blocks lifecycle scripts.
  6. Behavior Analysis: Static analysis of package dependencies and runtime monitoring.
  7. Risk Scoring: Automated risk assessment based on multiple security indicators.
  8. Immutable Patches: Security patches cannot be easily bypassed or removed.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for contribution guidelines, then open an issue or submit a pull request.

License

MIT