1.0.0-alpha.15 • Published 1 year ago

course-pack v1.0.0-alpha.15

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Course Pack

Course Pack is a serialized collection of courses, instructors, programs, and providers.

Course Pack is the official supported data source format of UniCourse.

Format

You can find the format specification here (JSON Schema).

Subtypes

Course Pack has two subtypes: Frozen Course Pack and Extendable Course Pack.

A Course Pack is Frozen if all of the id-like fields are CUIDs, which makes the data immutable and interchangeable with UniCourse database.

If a Course Pack is not Frozen, we call it Extendable, which takes the advantage of the flexibility of custom id formats and can be easily merged with other Course Packs in the same convention.

Verify Course Pack

You can use verify function to type-safe verify a Course Pack.

import fs from "node:fs";
import type { CoursePack } from "course-pack";
import { verify } from "course-pack";

const pack: unknown = JSON.parse(fs.readFileSync("course-pack.json", "utf-8"));
try {
    const verified: CoursePack = verify(pack);
    console.log(verified);
} catch (error) {
    console.error(error);
}
1.0.0-alpha.15

1 year ago

1.0.0-alpha.14

1 year ago

1.0.0-alpha.13

1 year ago

1.0.0-alpha.12

1 year ago

1.0.0-alpha.11

1 year ago

1.0.0-alpha.10

1 year ago

1.0.0-alpha.9

1 year ago

1.0.0-alpha.8

1 year ago

1.0.0-alpha.7

1 year ago

1.0.0-alpha.6

1 year ago

1.0.0-alpha.5

1 year ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago