@luhanxin/config
v3.0.0
Published
Configuration loading and validation for the automation toolkit
Maintainers
Readme
@luhanxin/config
加载和校验 Puppeteer 自动化项目配置。
安装
pnpm add @luhanxin/config使用
import {defineConfig, loadConfig} from '@luhanxin/config';
export default defineConfig({
testDir: 'tests',
artifactsDir: 'test-results',
browser: {headless: true}
});
const config = await loadConfig();配置支持 TypeScript、MTS、JavaScript、MJS 和 CJS 文件,并通过 Zod 应用默认值和校验。
API
defineConfig(config)loadConfig(options?)defaultConfigConfigErrordisplayPath(rootDir, filePath)
构建
pnpm build
pnpm typecheck