npm.io
0.17.10 • Published 3 weeks agoCLI

unlighthouse

Licence
MIT
Version
0.17.10
Deps
3
Size
6 kB
Vulns
0
Weekly
0

unlighthouse

The main package for Unlighthouse - scan your entire website with Google Lighthouse. This is a convenience package that includes the core functionality and CLI tools.

Quick Start

# Scan your website instantly
npx unlighthouse --site https://example.com

# CI mode with performance budgets
npx unlighthouse-ci --site https://example.com --budget 80

What's Included

This package includes:

  • @unlighthouse/core - Core scanning engine
  • @unlighthouse/cli - Command-line interface
  • @unlighthouse/client - Web interface for results
  • Two binaries: unlighthouse and unlighthouse-ci

Installation

# Global installation
npm install -g unlighthouse

# Project dependency
npm install unlighthouse --save-dev

Usage

Interactive CLI
# Basic scan
unlighthouse --site https://example.com

# With debugging and custom device
unlighthouse --site https://example.com --debug --desktop

# Custom configuration
unlighthouse --config-file unlighthouse.config.ts
Programmatic Usage
import { createUnlighthouse } from 'unlighthouse'

const unlighthouse = await createUnlighthouse({
  site: 'https://example.com',
  debug: true
})

await unlighthouse.start()
CI Integration
# Enforce performance budgets in CI
unlighthouse-ci --site https://example.com --budget 85

Configuration

Create unlighthouse.config.ts:

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  site: 'https://example.com',
  scanner: {
    device: 'desktop',
    throttle: false,
  },
  lighthouseOptions: {
    onlyCategories: ['performance', 'accessibility'],
  }
})

Documentation

License

MIT License 2021-PRESENT Harlan Wilton

Keywords