DataPack

Class to interact with data packs .

Constructor

new DataPack(params)

Interact with data packs

Parameters:
NameTypeDescription
paramsObject
Properties
NameTypeAttributesDefaultDescription
dataPacksstring | Array.<string>

the data packs you wish to load

indexFieldsArray.<string><optional>
@id, name, alternateName, languageCode

the fields you wish to index over

cacheboolean<optional>
true

whether to cache the data file for repeated lookups. The cache will automatically invalidate after 1 hour

Methods

get(params)

Get something from the datapacks

Parameters:
NameTypeDescription
paramsObject
Properties
NameTypeDescription
fieldstring

the field to search on, e.g.: '@id'

valuestring

the string to search for

propertiesArray.<string>

the properties to include in the search results

(async) load()

Load the data packs and index them