H5P NodeJS Library
    Preparing search index...

    Stores libraries in a directory.

    Implements

    Index

    Constructors

    Properties

    ignoredFilePatterns: RegExp[] = []

    Files with this pattern are not returned when listing the directory contents. Can be used by classes extending FileLibraryStorage to hide internals.

    librariesDirectory: string

    The path of the directory in the file system at which libraries are stored.

    Methods

    • Adds a library file to a library. The library metadata must have been installed with installLibrary(...) first. Throws an error if something unexpected happens.

      Parameters

      • library: ILibraryName

        The library that is being installed

      • filename: string

        Filename of the file to add, relative to the library root

      • stream: Readable

        The stream containing the file content

      Returns Promise<boolean>

      true if successful

    • Counts how often libraries are listed in the dependencies of other libraries and returns a list of the number.

      Returns Promise<{ [ubername: string]: number }>

      an object with ubernames as key. Example: { 'H5P.Example': 10 } This means that H5P.Example is used by 10 other libraries.