@browser-compat/core
v0.1.2
Published
Core manifest schema, validation, and compatibility decisions for browser-compat.
Readme
@browser-compat/core
Core types, manifest validation, and compatibility decisions for the Browser Compat toolkit.
Browser Compat helps applications generate browser compatibility manifests from
their own browserslist targets, check those manifests in CI, and use the
result at runtime through small framework adapters.
What This Package Does
@browser-compat/core contains the shared logic used by the CLI, runtime, and
framework adapters:
- compatibility manifest types
- manifest creation and validation
- runtime feature extraction
- manifest freshness checks against current browser targets
- compatibility status decisions
This package has no DOM or React dependency.
Most applications use it indirectly through @browser-compat/cli,
@browser-compat/runtime, or @browser-compat/react.
Installation
npm install @browser-compat/coreUsage
import { validateCompatManifest } from "@browser-compat/core";
const result = validateCompatManifest(manifest);
if (!result.ok) {
console.error(result.errors);
}Related Packages
@browser-compat/cligenerates manifests.@browser-compat/runtimeevaluates manifests in the browser.@browser-compat/reactexposes runtime state to React apps.
Full documentation: https://github.com/relaxcloud-cn/browser-compat-package
