internetarchive-ts - v0.1.0
    Preparing search index...

    Function getFiles

    • Beta

      Get IaFile objects from an item.

      Type Parameters

      Parameters

      • identifier: string

        The globally unique Archive.org identifier for a given item.

      • params: {
            archiveSession?: IaSession;
            config?: IaAuthConfig;
            excludePattern?: string | string[];
            files?: string | string[];
            formats?: string | string[];
            globPattern?: string | string[];
            onTheFly?: boolean;
        } = {}
        • OptionalarchiveSession?: IaSession

          Optional archiveSession object. If not defined, one will be created internally

        • Optionalconfig?: IaAuthConfig

          Configuration

        • OptionalexcludePattern?: string | string[]

          Exclude files matching the given glob pattern

        • Optionalfiles?: string | string[]

          Only return files matching the given filenames

        • Optionalformats?: string | string[]

          Only return files matching the given formats

        • OptionalglobPattern?: string | string[]

          Only return files matching the given glob pattern

        • OptionalonTheFly?: boolean

          Include on-the-fly files (i.e. derivative EPUB)

      Returns Promise<Generator<IaFile<ItemFileMetaType>, any, unknown>>

      Files from an item.

      import {getFiles} from "internetarchive-ts";
      let fnames = (await getFiles('nasa', {globPattern:'*xml'})).map(f => f.name)
      ['nasa_reviews.xml', 'nasa_meta.xml', 'nasa_files.xml']