@dpkit/core
Version:
Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames
13 lines (11 loc) • 436 B
text/typescript
import { loadDescriptor } from "../general/index.ts"
import { assertPackage } from "./assert.ts"
/**
* Load a Package descriptor (JSON Object) from a file or URL
* Ensures the descriptor is valid against its profile
*/
export async function loadPackageDescriptor(path: string) {
const { basepath, descriptor } = await loadDescriptor(path)
const dataPackage = await assertPackage(descriptor, { basepath })
return dataPackage
}