Dynamic module fs

Index

Interfaces

Functions

Functions

appendFile(filename: string, data: any, encoding?: string, callback?: Function)

Parameters

  • filename: string
  • data: any
  • encoding?: string optional
  • callback?: Function optional

appendFileSync(filename: string, data: any, encoding?: string)

Parameters

  • filename: string
  • data: any
  • encoding?: string optional

chmod(path: string, mode: string, callback?: Function)

Parameters

  • path: string
  • mode: string
  • callback?: Function optional

chmodSync(path: string, mode: string)

Parameters

  • path: string
  • mode: string

chown(path: string, uid: number, gid: number, callback?: Function)

Parameters

  • path: string
  • uid: number
  • gid: number
  • callback?: Function optional

chownSync(path: string, uid: number, gid: number)

Parameters

  • path: string
  • uid: number
  • gid: number

close(fd: string, callback?: Function)

Parameters

  • fd: string
  • callback?: Function optional

closeSync(fd: string)

Parameters

  • fd: string

createReadStream(path: string, options?: { flags?: string; encoding?: string; fd?: string; mode?: number; bufferSize?: number; }): ReadStream

Parameters

  • path: string
  • options?: { flags?: string; encoding?: string; fd?: string; mode?: number; bufferSize?: number; } optional

Returns

ReadStream

createWriteStream(path: string, options?: { flags?: string; encoding?: string; string?: string; }): WriteStream

Parameters

  • path: string
  • options?: { flags?: string; encoding?: string; string?: string; } optional

Returns

WriteStream

exists(path: string, callback?: (exists: boolean) => void)

Parameters

  • path: string
  • callback?: (exists: boolean) => void optional

existsSync(path: string): boolean

Parameters

  • path: string

Returns

boolean

fchmod(fd: string, mode: string, callback?: Function)

Parameters

  • fd: string
  • mode: string
  • callback?: Function optional

fchmodSync(fd: string, mode: string)

Parameters

  • fd: string
  • mode: string

fchown(fd: string, uid: number, gid: number, callback?: Function)

Parameters

  • fd: string
  • uid: number
  • gid: number
  • callback?: Function optional

fchownSync(fd: string, uid: number, gid: number)

Parameters

  • fd: string
  • uid: number
  • gid: number

fstat(fd: string, callback?: (err: Error, stats: "fs".Stats) => any): Stats

Parameters

  • fd: string
  • callback?: (err: Error, stats: "fs".Stats) => any optional

Returns

Stats

fstatSync(fd: string): Stats

Parameters

  • fd: string

Returns

Stats

fsync(fd: string, callback?: Function)

Parameters

  • fd: string
  • callback?: Function optional

fsyncSync(fd: string)

Parameters

  • fd: string

futimes(fd: string, atime: number, mtime: number, callback?: Function)

Parameters

  • fd: string
  • atime: number
  • mtime: number
  • callback?: Function optional

futimesSync(fd: string, atime: number, mtime: number)

Parameters

  • fd: string
  • atime: number
  • mtime: number

lchmod(path: string, mode: string, callback?: Function)

Parameters

  • path: string
  • mode: string
  • callback?: Function optional

lchmodSync(path: string, mode: string)

Parameters

  • path: string
  • mode: string

lchown(path: string, uid: number, gid: number, callback?: Function)

Parameters

  • path: string
  • uid: number
  • gid: number
  • callback?: Function optional

lchownSync(path: string, uid: number, gid: number)

Parameters

  • path: string
  • uid: number
  • gid: number

link(srcpath: string, dstpath: string, callback?: Function)

Parameters

  • srcpath: string
  • dstpath: string
  • callback?: Function optional

linkSync(srcpath: string, dstpath: string)

Parameters

  • srcpath: string
  • dstpath: string

lstat(path: string, callback?: (err: Error, stats: "fs".Stats) => any): Stats

Parameters

  • path: string
  • callback?: (err: Error, stats: "fs".Stats) => any optional

Returns

Stats

lstatSync(path: string): Stats

Parameters

  • path: string

Returns

Stats

mkdir(path: string, mode?: string, callback?: Function)

Parameters

  • path: string
  • mode?: string optional
  • callback?: Function optional

mkdirSync(path: string, mode?: string)

Parameters

  • path: string
  • mode?: string optional

open(path: string, flags: string, mode?: string, callback?: (err: Error, fd: string) => any)

Parameters

  • path: string
  • flags: string
  • mode?: string optional
  • callback?: (err: Error, fd: string) => any optional

openSync(path: string, flags: string, mode?: string)

Parameters

  • path: string
  • flags: string
  • mode?: string optional

read(fd: string, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: Buffer) => void)

Parameters

  • fd: string
  • buffer: Buffer
  • offset: number
  • length: number
  • position: number
  • callback?: (err: Error, bytesRead: number, buffer: Buffer) => void optional

readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void)

Parameters

  • filename: string
  • encoding: string
  • callback: (err: Error, data: string) => void

readFile(filename: string, callback: (err: Error, data: Buffer) => void)

Parameters

  • filename: string
  • callback: (err: Error, data: Buffer) => void

readFileSync(filename: string): Buffer

Parameters

  • filename: string

Returns

Buffer

readFileSync(filename: string, encoding: string): string

Parameters

  • filename: string
  • encoding: string

Returns

string

readSync(fd: string, buffer: Buffer, offset: number, length: number, position: number): Array<any>

Parameters

  • fd: string
  • buffer: Buffer
  • offset: number
  • length: number
  • position: number

Returns

Array<any>

readdir(path: string, callback?: (err: Error, files: string[]) => void)

Parameters

  • path: string
  • callback?: (err: Error, files: string[]) => void optional

readdirSync(path: string): Array<string>

Parameters

  • path: string

Returns

Array<string>

readlink(path: string, callback?: (err: Error, linkString: string) => any)

Parameters

  • path: string
  • callback?: (err: Error, linkString: string) => any optional

realpath(path: string, callback?: (err: Error, resolvedPath: string) => any)

Parameters

  • path: string
  • callback?: (err: Error, resolvedPath: string) => any optional

realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => any)

Parameters

  • path: string
  • cache: string
  • callback: (err: Error, resolvedPath: string) => any

realpathSync(path: string, cache?: string)

Parameters

  • path: string
  • cache?: string optional

rename(oldPath: string, newPath: string, callback?: Function)

Parameters

  • oldPath: string
  • newPath: string
  • callback?: Function optional

renameSync(oldPath: string, newPath: string)

Parameters

  • oldPath: string
  • newPath: string

rmdir(path: string, callback?: Function)

Parameters

  • path: string
  • callback?: Function optional

rmdirSync(path: string)

Parameters

  • path: string

stat(path: string, callback?: (err: Error, stats: "fs".Stats) => any): Stats

Parameters

  • path: string
  • callback?: (err: Error, stats: "fs".Stats) => any optional

Returns

Stats

statSync(path: string): Stats

Parameters

  • path: string

Returns

Stats

symlink(srcpath: string, dstpath: string, type?: string, callback?: Function)

Parameters

  • srcpath: string
  • dstpath: string
  • type?: string optional
  • callback?: Function optional

symlinkSync(srcpath: string, dstpath: string, type?: string)

Parameters

  • srcpath: string
  • dstpath: string
  • type?: string optional

truncate(fd: string, len: number, callback?: Function)

Parameters

  • fd: string
  • len: number
  • callback?: Function optional

truncateSync(fd: string, len: number)

Parameters

  • fd: string
  • len: number

unlink(path: string, callback?: Function)

Parameters

  • path: string
  • callback?: Function optional

unlinkSync(path: string)

Parameters

  • path: string

unwatchFile(filename: string, listener?: Stats)

Parameters

  • filename: string
  • listener?: Stats optional

utimes(path: string, atime: number, mtime: number, callback?: Function)

Parameters

  • path: string
  • atime: number
  • mtime: number
  • callback?: Function optional

utimesSync(path: string, atime: number, mtime: number)

Parameters

  • path: string
  • atime: number
  • mtime: number

watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher

Parameters

  • filename: string
  • options?: { persistent?: boolean; } optional
  • listener?: (event: string, filename: string) => any optional

Returns

FSWatcher

watchFile(filename: string, listener: { curr: "fs".Stats; prev: "fs".Stats; })

Parameters

  • filename: string
  • listener: { curr: "fs".Stats; prev: "fs".Stats; }

watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: "fs".Stats; prev: "fs".Stats; })

Parameters

  • filename: string
  • options: { persistent?: boolean; interval?: number; }
  • listener: { curr: "fs".Stats; prev: "fs".Stats; }

write(fd: string, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: Buffer) => any)

Parameters

  • fd: string
  • buffer: Buffer
  • offset: number
  • length: number
  • position: number
  • callback?: (err: Error, written: number, buffer: Buffer) => any optional

writeFile(filename: string, data: any, callback?: (err: any) => void)

Parameters

  • filename: string
  • data: any
  • callback?: (err: any) => void optional

writeFile(filename: string, data: any, encoding?: string, callback?: (err: any) => void)

Parameters

  • filename: string
  • data: any
  • encoding?: string optional
  • callback?: (err: any) => void optional

writeFileSync(filename: string, data: any, encoding?: string)

Parameters

  • filename: string
  • data: any
  • encoding?: string optional

writeSync(fd: string, buffer: Buffer, offset: number, length: number, position: number)

Parameters

  • fd: string
  • buffer: Buffer
  • offset: number
  • length: number
  • position: number