š“ Gradual feature flags.
npm install compatxcompatx

š“ Compatibility toolkit.
> [!NOTE]
> This is a WIP toolkit. See RFC for initial motivations.
``sh⨠Auto-detect
npx nypm install -D compatx
Utils
$3
Format compatibility date spec to a string
$3
Format a date to a
YYYY-MM-DD stringExample:
`ts
formatDateString(new Date("2021/01/01")) // "2021-01-01"
`$3
Get compatibility changes between two dates.
$3
Get compatibility updates applicable for the user given platform and date range.
$3
- Type:
array
- Default: ["aws","azure","cloudflare","deno","firebase","netlify","vercel"]$3
Normalize the compatibility dates from input config and defaults.
$3
Resolve compatibility dates with environment variables as defaults.
Environment variable name format is
COMPATIBILITY_DATE for default and COMPATIBILITY_DATE_ for specific platforms.Types
`js
import type {
// Typed date string in YYYY-MM-DD format
DateString,
// Platform names
PlatformName,
// Compatibility dates
CompatibilityDateSpec,
CompatibilityDates,
// Compatibility updates
CompatibilityUpdate,
CompatibilityUpdates
} from "./types";
`Development
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using pnpm install
- Run interactive tests using pnpm dev`Made with š
Published under MIT License.