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

@oktan-lab/dev-shield

v1.0.4

Published

Pre-flight security scanner for config files before running dev servers

Readme

dev-shield

NPM Last Update NPM Collaborators

dev-shield is a comprehensive Security Posture Management Tool and pre-flight scanner designed specifically to secure your local Node.js development environment.

With the rise of supply-chain attacks, threat actors increasingly target developer machines by injecting malicious payloads into configuration files, dependencies, and lockfiles. dev-shield acts as an active safeguard, analyzing your workspace and actively monitoring runtime network connections before your dev server runs.

Key Features

  • Static Application Security Testing (SAST): Parses configuration files (Tailwind, Next.js, Vite) and core entry points using an Abstract Syntax Tree (AST) to detect code obfuscation, forbidden system module invocations, and dynamic code execution (e.g., eval).
  • Dependency & Typosquatting Check: Scans your package.json for known typosquatting packages and suspicious postinstall scripts containing malicious commands.
  • Lockfile Integrity Analyzer: Analyzes package-lock.json to ensure that resolved tarball URLs point to standard, trusted registries, preventing package hijacking.
  • Hardcoded Secret Scanner: Scans your .env and source code for accidentally hardcoded secrets (AWS Keys, Slack Tokens, GitHub PATs).
  • Runtime Network Monitoring (Monkey-Patching): Injects a pre-load script before the dev server starts to monitor http, https, and net outbound traffic. Unrecognized domains are blocked by default to prevent data exfiltration.
  • CI/CD Ready: Supports JSON report generation for seamless integration with GitHub Actions or GitLab CI.

Installation

Install the package globally or locally as a dev dependency:

# Global install (Recommended for standalone usage)
npm install -g @oktan-lab/dev-shield

# Local install (As a dev dependency in your project)
npm install -D @oktan-lab/dev-shield

Demo: Detecting Obfuscated Payloads

When dev-shield detects obfuscated malware in your configurations (e.g. tailwind.config.js), it immediately aborts the execution before your development server even starts:

Scan Result

⚡oktan >> npm run dev

> [email protected] dev
> npx @oktan-lab/dev-shield/dev-shield next dev --turbopack

[dev-shield] Starting security analysis...

 [dev-shield] SECURITY VULNERABILITIES DETECTED 

[AST] tailwind.config.js
  - Line 501 has an unusual length (16357 characters).

[AST] tailwind.config.js
  - Dynamic require() detected, commonly used by malware loaders.

 EXECUTION ABORTED: Security threats detected in your workspace! 

Setup & Configuration

You can generate the default configuration file (.dev-shield.json) by running the initialization command:

npx @oktan-lab/dev-shield/dev-shield init

This will create a .dev-shield.json file in your project root:

{
  "networkMode": "block",
  "whitelistedDomains": [
    "localhost",
    "127.0.0.1",
    "vercel.com",
    "supabase.co",
    "supabase.com",
    "github.com"
  ],
  "customRules": []
}
  • networkMode: Set to "warn" if you only want to log network violations instead of blocking them.
  • whitelistedDomains: Add your trusted external API domains here so your application can reach them during development.

Usage

Use dev-shield as a wrapper in front of your usual commands.

If your original command is next dev, use:

npx @oktan-lab/dev-shield/dev-shield next dev

If dev-shield determines the workspace is safe, it will immediately execute next dev under its runtime network monitor. If a threat is detected, the process is automatically aborted (exit code 1).

Integration via package.json scripts

This is the recommended approach. Add the dev-shield prefix to your dev or start scripts.

{
  "scripts": {
    "dev": "dev-shield next dev",
    "build": "dev-shield next build"
  }
}

CI/CD Reporting

To run a scan-only check and generate a JSON report (without spawning a dev server), use:

dev-shield --scan-only --report json

This will generate a dev-shield-report.json file in your workspace containing the security analysis results.

Git Hook Integration (Example with Husky)

Use as a pre-commit hook wrapper to ensure you do not commit malware from compromised dependencies.

npx husky add .husky/pre-commit "npx @oktan-lab/dev-shield/dev-shield --scan-only"

License

MIT © 2026 oktan-lab/dev-shield