data-test-api
    Preparing search index...

    Interface FileEntry<P>

    Represents a file entry in the DataTestApi. Get basic info like, name, relative path, etc. Get file stream or buffer.

    interface FileEntry<P extends Path<string> = Path<string>> {
        basename: string;
        buffer: () => Promise<Buffer<ArrayBufferLike>>;
        extension: string;
        name: string;
        path: P;
        relativePath: string;
        stream: () => ReadStream;
    }

    Type Parameters

    Index

    Properties

    basename: string

    The name without extension

    'file'
    
    buffer: () => Promise<Buffer<ArrayBufferLike>>

    getter of the buffer file

    extension: string

    The file extension

    '.txt'
    
    name: string

    The name of the file (with extension)

    'file.txt'
    
    path: P

    The path to the file

    'data/subfolder/file.txt'
    
    '/absolute/path/to/data/subfolder/file.txt'
    
    relativePath: string

    Relative from instance DataTestApi root

    'subfolder/file.txt'
    
    stream: () => ReadStream

    getter of the file stream