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

baseline-gardener

v1.2.0

Published

🌱 Nurture baseline-compatible web code - A CI/CD tool to check web feature baseline compatibility

Readme

Baseline Gardener

🌱 Baseline Gardener

Nurture baseline-compatible web code - A CI/CD tool to check web feature baseline compatibility

A practical tool for modern web development workflows.

What is Baseline?

Baseline Gardener

Baseline provides clear information about which web platform features work across modern browsers. Baseline Gardener helps you:

  • βœ… Avoid compatibility surprises - Know what won't work before users complain
  • πŸ“ˆ Make informed decisions - Data-driven choices about when to adopt new features
  • πŸš€ Ship with confidence - Automated compatibility checking in CI/CD
  • πŸ“Š Track adoption - See your baseline compatibility improve over time

Features

  • πŸ” Multi-language support: JavaScript, CSS, HTML, Vue, Svelte
  • πŸ“Š Multiple output formats: Text, JSON, Markdown, SARIF
  • 🚨 CI/CD integration: GitHub Actions, custom workflows
  • βš™οΈ Configurable thresholds: Widely vs newly available features
  • πŸ“ Rich reporting: Detailed compatibility insights
  • πŸ”„ Always fresh data: Auto-generates from latest web-features package

Quick Start

Installation

npm install -g baseline-gardener

Basic Usage

# Scan current directory
baseline-gardener scan

# Scan specific path
baseline-gardener scan ./src

# Require only widely available features
baseline-gardener scan --require-baseline widely

# Generate markdown report
baseline-gardener scan --format markdown -o report.md

Command Line Options

baseline-gardener scan [path] [options]

Options:
  -f, --format <format>         Output format (text, json, markdown, sarif, ai)
  --require-baseline <level>    Required baseline level (widely, newly)
  --allow-experimental          Allow non-baseline features
  --update-baseline            Update to latest web-features data
  --ai                         Generate AI-optimized markdown for LLM auto-fixing
  -o, --output <file>          Output file (default: stdout)
  --config <path>              Path to config file
  -h, --help                   Display help

Configuration

Create a .baselinerc.json file in your project root:

{
  "minBaseline": "newly",
  "ignorePaths": [
    "node_modules/",
    "dist/",
    "*.min.js"
  ],
  "ignoreFeatures": [
    "experimental-feature-id"
  ],
  "failOnNonBaseline": true
}

What Gets Detected

JavaScript APIs

  • Browser APIs (navigator.*, window.*)
  • DOM methods (document.querySelector, element methods)
  • Modern JS features (ES6+, Web APIs)
  • Fetch API, Storage APIs, etc.

CSS Features

  • Properties (container-type, backdrop-filter)
  • Values (grid, flex, subgrid)
  • Selectors (:has(), :is(), ::marker)
  • At-rules (@container, @layer)

HTML Elements

  • Modern elements (<dialog>, <details>)
  • Input types (email, date, color)
  • Attributes (loading, decoding)

CI/CD Integration

GitHub Actions

name: Baseline Check
on: [push, pull_request]

jobs:
  baseline:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: '20'
    - run: npm install -g baseline-gardener
    - run: baseline-gardener scan --format sarif -o results.sarif
    - uses: github/codeql-action/upload-sarif@v3
      with:
        sarif_file: results.sarif

Other CI Systems

# Any CI system
npm install -g baseline-gardener
baseline-gardener scan --format json

Output Formats

Text (Default)

Human-readable terminal output with colors and formatting.

JSON

Machine-readable format for integration with other tools:

{
  "metadata": { "tool": "baseline-gardener", "version": "1.0.0" },
  "summary": { "totalFiles": 12, "baselineFeatures": 45, "issues": 3 },
  "issues": [...]
}

Markdown

Perfect for documentation and reports:

# πŸ” Baseline Guardian Report

## πŸ“Š Summary
- Files scanned: 12
- Baseline compatible: 45
- Issues found: 3

SARIF

For GitHub Code Scanning and security tools integration.

AI Format

AI-optimized markdown designed for LLM processing and automatic code fixing:

baseline-gardener scan --ai -o ai-report.md

This format includes:

  • Structured issue breakdown by file and location
  • Code context with problematic snippets
  • Fix suggestions with baseline-compatible alternatives
  • AI processing instructions for automated remediation
  • Explanation of issues to help LLMs understand the context

Perfect for feeding into Claude, GPT, or other LLMs for automatic baseline compatibility fixes.

Real-World Example

Check out our React demo repository that shows baseline-gardener in action with:

  • βœ… Baseline-safe code using widely available features
  • ❌ Experimental code using cutting-edge APIs
  • πŸ”§ CI/CD setup with GitHub Actions

How It Works

  1. Parse your code using industry-standard parsers:

    • JavaScript: Babel AST parser
    • CSS: css-tree parser
    • HTML: htmlparser2
  2. Detect feature usage through comprehensive mapping tables:

    • JavaScript APIs (global functions, browser APIs, DOM methods)
    • CSS properties and values (modern layout, styling features)
    • HTML elements and attributes (semantic markup, input types)
  3. Check baseline status against fresh web-features data:

    • High: Widely available (safe everywhere)
    • Low: Newly available (modern browsers)
    • False: Limited availability (experimental)
  4. Generate actionable reports with clear recommendations

Development

Build from source

git clone https://github.com/hjanuschka/baseline-gardener
cd baseline-gardener
npm install
npm run build
npm link

Testing

npm test
npm run lint

Updating Feature Mappings

# Update to latest web-features data
npm run baseline:update

Architecture

baseline-gardener/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ parsers/          # Language-specific parsers
β”‚   β”œβ”€β”€ detectors/        # Feature detection logic  
β”‚   β”œβ”€β”€ baseline/         # web-features integration
β”‚   β”œβ”€β”€ reporters/        # Output format generators
β”‚   └── cli.ts           # Command-line interface
β”œβ”€β”€ mappings/            # Dynamic feature mapping tables
β”‚   β”œβ”€β”€ *-generated.json  # Auto-generated from web-features
β”‚   └── all-features-generated.json
└── package.json

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Adding New Features

Feature mappings are automatically generated from the latest web-features data:

  1. Run mapping update: npm run baseline:update
  2. Update parsers if needed for new detection patterns
  3. Add tests for the new features
  4. Update documentation

FAQ

Q: How accurate is the baseline data? A: We use the official web-features package maintained by the WebDX Community Group and updated regularly.

Q: Can I customize which features to check?
A: Yes! Use .baselinerc.json to ignore specific features or file patterns.

Q: Does this replace caniuse.com? A: No, it complements it! This tool automates checking YOUR code against baseline data, while caniuse is for manual research.

Q: What about polyfills? A: Configure ignored features for APIs you're polyfilling. The tool focuses on native browser support.

License

MIT

Credits


⭐ Star this repo if baseline-gardener helps you ship better web apps!