workflow.datapackage.md

February 1, 2023 ยท View on GitHub

Home > @datashaper/workflow > DataPackage

DataPackage class

Signature:

export declare class DataPackage extends Resource 

Extends: Resource

Constructors

ConstructorModifiersDescription
(constructor)(profiles)Constructs a new instance of the DataPackage class

Properties

PropertyModifiersTypeDescription
$schemareadonlystring
isEmptyreadonlyboolean
isEmpty$readonlyObservable<boolean>
namesreadonlystring[]
names$readonlyObservable<string[]>
profilereadonly(not declared)
resourceManagerreadonlyResourceManager
resourcesreadonlyResource[]
resources$readonlyObservable<Resource[]>
sizereadonlynumber
size$readonlyObservable<number>

Methods

MethodModifiersDescription
addResource(resource, top)
addResourceHandler(handler)Registers a new handler for processing resources.
clear()
defaultTitle()
getResource(name)
load(files, quiet)

Load the data-package from an archive of files, usually hydrated from a zip.

The load process occurs in stages.

In the first stage, the datapackage.json file is loaded and recursed to create a hierarchy of objects that represent the resource tree.

In the second stage, we walk the resource tree and link together resources that have cross-references.

loadSchema()
removeResource(name)
save()
suggestResourceName(name)Suggests a new, unique resource name for a resource to adopt
toSchema()