Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/whywaita/xcodereleases-deno-sdk

Type definition of https://xcodereleases.com for deno
https://github.com/whywaita/xcodereleases-deno-sdk

deno deno-module xcode xcoderelease

Last synced: 25 days ago
JSON representation

Type definition of https://xcodereleases.com for deno

Awesome Lists containing this project

README

        

# xcodereleases-deno-sdk

[![JSR](https://jsr.io/badges/@whywaita/xcodereleases-deno-sdk)](https://jsr.io/@whywaita/xcodereleases-deno-sdk)
[![npm version](https://badge.fury.io/js/xcodereleases-deno-sdk.svg)](https://badge.fury.io/js/xcodereleases-deno-sdk)

xcodereleases-deno-sdk provides Type definition of [xcodereleases.com](https://xcodereleases.com) for deno

## Usage

```typescript
import type { XcodeRelease } from "jsr:@whywaita/[email protected]";

// Get all xcode releases
const xr: XcodeRelease[] = await GetXcodeReleases();

// Example 1: all OS compatible versions side-by-side
const releasesVersions: XcodeRelease[] = GetXcodeReleasesByRelease(
xr,
"release",
);
const compatibleVersions: XcodeRelease[] =
GetXcodeReleasesCompatibleVersion(
releasesVersions,
macOSVersion,
);

// Example 2: for beta, GM versions - latest beta only
const betaVersions: XcodeRelease[] = GetXcodeReleasesByRelease(xr, "beta");
result = result.concat(betaVersions[0]);
const gmVersions: XcodeRelease[] = GetXcodeReleasesByRelease(xr, "gm");
result = result.concat(gmVersions[0]);

// Example 3: old patch versions are deprecated in 3 months
const date = new Date();
date.setMonth(date.getMonth() - 3);
const oldVersions: XcodeRelease[] = GetXcodeReleasesSinceDate(xr, date);
```