Options
All
  • Public
  • Public/Protected
  • All
Menu

recursive-readdir-async

author:

m0rtadelo (ricard.figuls)

license

MIT 2018

Index

Variables

FS

FS: __module = _fs

native node fs object

LIST

LIST: 1 = 1
readonly

constant for mode LIST to be used in Options

PATH

PATH: PlatformPath = _path

native node path object

TREE

TREE: 2 = 2
readonly

constant for mode TREE to be used in Options

Functions

list

  • Returns a javascript object with directory items information (non blocking async with Promises)

    async

    Parameters

    • path: string

      the path to start reading contents

    • Optional options: Function | IOptions

      (mode, recursive, stats, ignoreFolders)

    • Optional progress: Function

    Returns Promise<(IFile | IFolder)[] | IError | any>

    promise array with file/folder information

readFile

  • readFile(file: Buffer, encoding?: undefined | BufferEncoding): Promise<string>
  • Returns a Promise with content (data) of the file

    async

    Parameters

    • file: Buffer

      the name of the file to read content from

    • encoding: undefined | BufferEncoding = 'base64'

      format for returned data (ascii, base64, binary, hex, ucs2/ucs-2/utf16le/utf-16le, utf8/utf-8, latin1). Default: base64

    Returns Promise<string>

    data content string (base64 format by default)

stat

  • stat(buffer: Buffer): Promise<_fs.Stats>
  • Returns a Promise with Stats info of the item (file/folder/...)

    async

    Parameters

    • buffer: Buffer

    Returns Promise<_fs.Stats>

    stat object information

Generated using TypeDoc