🌴 Compatibility toolkit.
[!NOTE] This is a WIP toolkit. See RFC for initial motivations.
# ✨ Auto-detect
npx nypm install -D compatx
# npm
npm install -D compatx
# yarn
yarn add -D compatx
# pnpm
pnpm install -D compatx
# bun
bun install -D compatx
Format compatibility date spec to a string
Format a date to a YYYY-MM-DD
string
Example:
formatDateString(new Date("2021/01/01")) // "2021-01-01"
Get compatibility changes between two dates.
Get compatibility updates applicable for the user given platform and date range.
-
Type:
array
-
Default:
["aws","azure","cloudflare","deno","firebase","netlify","vercel"]
Normalize the compatibility dates from input config and defaults.
Resolve compatibility dates with environment variables as defaults.
Environment variable name format is COMPATIBILITY_DATE
for default and COMPATIBILITY_DATE_<PLATFORM>
for specific platforms.
import type {
// Typed date string in `YYYY-MM-DD` format
DateString,
// Platform names
PlatformName,
// Compatibility dates
CompatibilityDateSpec,
CompatibilityDates,
// Compatibility updates
CompatibilityUpdate,
CompatibilityUpdates
} from "./types";
- 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.