@unlighthouse/core
v0.17.4
Published
Scan your entire website with Google Lighthouse.
Maintainers
Readme
@unlighthouse/core
The core engine of Unlighthouse that handles website scanning, Lighthouse execution, and report generation.
Usage
Basic Usage
import { createUnlighthouse } from '@unlighthouse/core'
const unlighthouse = await createUnlighthouse({
site: 'https://example.com',
debug: true,
scanner: {
device: 'desktop',
}
})
await unlighthouse.start()With Custom Provider
import { createUnlighthouse } from '@unlighthouse/core'
const unlighthouse = await createUnlighthouse(
{ /* user config */ },
{
name: 'custom',
routeDefinitions: () => generateRouteDefinitions(),
}
)Hooks
import { useUnlighthouse } from '@unlighthouse/core'
const { hooks } = useUnlighthouse()
hooks.hook('task-complete', (path, response) => {
console.log('Task completed for:', path)
})API
createUnlighthouse(userConfig, provider?)- Initialize UnlighthouseuseUnlighthouse()- Access the global Unlighthouse contextgenerateClient(options)- Generate static client files
Documentation
License
MIT License © 2021-PRESENT Harlan Wilton
