unlighthouse
v0.17.4
Published
Delightfully scan your entire website with Google Lighthouse. Navigate your performance, accessibility and SEO.
Downloads
63,928
Maintainers
Readme
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 80What's Included
This package includes:
@unlighthouse/core- Core scanning engine@unlighthouse/cli- Command-line interface@unlighthouse/client- Web interface for results- Two binaries:
unlighthouseandunlighthouse-ci
Installation
# Global installation
npm install -g unlighthouse
# Project dependency
npm install unlighthouse --save-devUsage
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.tsProgrammatic 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 85Configuration
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
