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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@evanjoel/code-scanner

v1.0.4

Published

code scanning tool

Downloads

14

Readme

Code Scanner (CS)

Security and code quality scanning tool

Supported Scanners

| Scanner | Languages | Purpose | |---------|-----------|---------| | Dependency-Check | Java, JavaScript, Python, .NET, Ruby, PHP, Go | Vulnerability scanning of dependencies | | ESLint | JavaScript, TypeScript | Static code analysis and linting | | NPM Audit | JavaScript, TypeScript | NPM package vulnerability scanning | | SonarQube | 25+ languages | Comprehensive code quality and security | | PMD | Java, JavaScript, Apex, Kotlin, Swift, XML, and more | Multi-language static analysis |

Installation

Global Installation (Recommended)

npm install -g code-scanner

Local Installation

npm install code-scanner

Verify Installation

npx cs --version

Quick Start

1. Setup Scanners

# Setup all scanners
npx cs setup

# Setup specific scanner
npx cs setup --scanner eslint

2. Create Configuration (Optional)

npx cs config -o cs.config.json

3. Run Security Scan

# Scan current directory with auto-detection
npx cs scan .

# Scan specific directory with custom output
cs scan /path/to/project --output my-results --format html

# Run specific scanner only
cs scan . --scanner dependency-check

# Run with Slack notifications
cs scan . --notify-slack --slack-webhook "your-webhook-url"

Configuration

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

{
  "notifications": {
    "slack": {
      "webhookUrl": "https://hooks.slack.com/services/...",
      "channel": "#security-alerts",
      "enabled": true
    }
  },
  "scanners": {
    "dependency-check": {
      "enabled": true,
      "nvdApiKey": "YOUR_NVD_API_KEY"
    },
    "eslint": {
      "enabled": true,
      "configFile": ".eslintrc.js"
    },
    "npm-audit": {
      "enabled": true
    },
    "sonarqube": {
      "enabled": false,
      "serverUrl": "http://localhost:9000",
      "token": "YOUR_SONAR_TOKEN"
    },
    "PMD": {
      "enabled": true
    }
  },
  "reporting": {
    "outputDir": "scan-results",
    "formats": ["json", "html"],
    "severity": "info",
    "failOnSeverity": "high"
  },
  "filters": {
    "exclude": [
      "**/node_modules/**",
      "**/dist/**",
      "**/build/**"
    ]
  }
}

Usage Examples

Basic Scanning

# Auto-detect and scan all supported files
cs scan .

Advanced Options

# Custom configuration and API keys
cs scan . \
  --config custom-config.json \
  --nvd-api-key "your-nvd-key" \
  --sonar-url "http://localhost:9000" \
  --sonar-token "your-token"

List available scanners

cs list


## CLI Commands

### Setup
```bash
cs setup [options]
  • -s, --scanner <name> - Setup specific scanner
  • -a, --all - Setup all scanners
  • --config <file> - Use specific configuration file

Scan

cs scan <target> [options]
  • -s, --scanner <name> - Run specific scanner only
  • -o, --output <dir> - Output directory (default: scan-results)
  • -f, --format <format> - Output format: json, html, pdf, sarif
  • -p, --parallel - Run scanners in parallel
  • --severity <level> - Minimum severity: critical, high, medium, low, info
  • --fail-on <severity> - Exit with error on severity level
  • --force - Force run disabled scanners
  • --notify-slack - Enable Slack notifications

Configuration

cs config [options]
  • -o, --output <file> - Output configuration file

Reporting

cs report <resultsFile> [options]
  • -f, --format <format> - Output format
  • -o, --output <dir> - Output directory

Environment Variables

# NVD API Key for enhanced vulnerability data
export NVD_API_KEY="your-nvd-api-key"

# SonarQube configuration
export SONAR_URL="http://localhost:9000"
export SONAR_TOKEN="your-sonar-token"

# Slack notifications
export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
export SLACK_CHANNEL="#security-alerts"