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

@hyandreas/greenlight

v1.0.0

Published

VS Code extension and GitHub Action for detecting non-Baseline web features

Readme

Greenlight

A comprehensive VS Code extension and GitHub Action that detects non-Baseline web features and provides compatibility warnings with quick fixes.

Features

  • 🔍 Real-time Detection: Parses JavaScript/TypeScript and CSS to detect non-Baseline web features
  • 📊 Multiple Output Formats: Console, JSON, Markdown, and SARIF for CI/CD integration
  • ⚙️ Flexible Configuration: Support for Baseline 2024/2025 targets or custom browserslist
  • 🔧 VS Code Integration: Real-time diagnostics with MDN links and polyfill suggestions
  • 🤖 GitHub Action: Automated PR comments with compatibility reports
  • 📈 Code Scanning: SARIF output for GitHub Advanced Security integration

🚀 Quick Start

CLI Usage

# Install globally
npm install -g @hyandreas/greenlight

# Check a single file
greenlight check src/components/modern-features.js

# Check multiple files with configuration
greenlight check "src/**/*.{js,ts,css}" --config baseline.config.json

# Generate different output formats
greenlight check src/app.js --format json
greenlight check src/app.js --format markdown
greenlight check src/app.js --format sarif

VS Code Extension

  1. Install from VS Code Marketplace: "Greenlight"
  2. Open a JavaScript/TypeScript/CSS file
  3. See real-time diagnostics for non-Baseline features
  4. Use quick fixes to add polyfills or alternative implementations

GitHub Action

name: Baseline Compatibility Check
on: [pull_request]

jobs:
  baseline-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./  # Use your greenlight action
        with:
          files: 'src/**/*.{js,ts,css}'
          baseline-target: '2024'
          output-format: 'markdown'
          comment-pr: true

⚙️ Configuration

Create a baseline.config.json in your project root:

{
  "baseline": {
    "target": "2024"
  },
  "severity": {
    "default": "warning",
    "features": {
      "optional-chaining": "info",
      "css-has-selector": "error"
    }
  },
  "include": [
    "src/**/*.{js,jsx,ts,tsx,css,scss,less}"
  ],
  "exclude": [
    "**/node_modules/**",
    "**/dist/**"
  ],
  "ignore": {
    "features": []
  }
}

Configuration Options

  • baseline.target: "2024", "2025", or custom browserslist query
  • severity.default: Default severity level ("error", "warning", "info")
  • severity.features: Override severity for specific features
  • include: Glob patterns for files to check
  • exclude: Glob patterns for files to ignore
  • ignore.features: Array of feature names to ignore

🔍 Detected Features

JavaScript/TypeScript

  • Optional chaining (obj?.prop)
  • Nullish coalescing (value ?? default)
  • Private class fields (#privateField)
  • Top-level await
  • Array.at() method
  • Static class blocks
  • And many more...

CSS

  • :has() selector
  • Container queries (@container)
  • Cascade layers (@layer)
  • CSS subgrid
  • color-mix() function
  • Individual transform properties
  • CSS nesting
  • And many more...

Web APIs

  • Clipboard API
  • Web Share API
  • Dialog element
  • Intersection Observer v2
  • CSS Typed OM
  • And many more...

📊 Output Formats

Console (Human-readable)

⚠️  Non-Baseline features detected:

📄 src/components/modern-features.js
  Line 3:  Optional chaining (?.) - Limited support in older browsers
  Line 5:  Private class field (#field) - ES2022 feature with limited support
  Line 12: Top-level await - Requires modern module support

📄 src/styles/modern.css
  Line 2:  :has() selector - Limited browser support
  Line 8:  Container queries - Experimental feature

JSON (Machine-readable)

{
  "results": [
    {
      "file": "src/app.js",
      "line": 3,
      "column": 12,
      "feature": "optional-chaining",
      "message": "Optional chaining (?.) requires modern browsers",
      "severity": "warning",
      "baseline": "unknown",
      "browserSupport": ["chrome", "firefox", "safari"]
    }
  ],
  "summary": {
    "totalFiles": 1,
    "totalIssues": 1,
    "byFeature": {
      "optional-chaining": 1
    }
  }
}

SARIF (GitHub Code Scanning)

Full SARIF 2.1.0 format for integration with GitHub Advanced Security and other static analysis tools.

🧪 Demo

Run the comprehensive demonstration:

node demo.js

This will showcase:

  • Configuration system
  • Feature detection across multiple file types
  • All output formats
  • Error handling
  • Performance testing
  • Integration capabilities

🏗️ Development

Setup

git clone <repository>
cd greenlight
npm install
npm run build

Testing

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run specific test suites
npm test -- test/parsers/
npm test -- test/integration/

Building

# Build CLI
npm run build:cli

# Build VS Code extension
npm run build:extension

# Package extension
npm run package:extension

# Build GitHub Action
npm run build:action

📁 Project Structure

greenlight/
├── src/
│   ├── cli/                 # Command-line interface
│   ├── core/                # Core detection logic
│   │   ├── parsers/         # JavaScript & CSS parsers
│   │   ├── config/          # Configuration system
│   │   └── output/          # Output formatters
│   ├── extension/           # VS Code extension
│   ├── action/              # GitHub Action
│   └── data/                # Web features dataset
├── test/                    # Test suites
├── sample-project/          # Demo project with modern features
└── docs/                    # Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for your changes
  4. Ensure all tests pass
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🔗 Links


A tool to help developers create more compatible web applications.