Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface File

Abstraction for a File. Similar to Project abstraction, broken into three distinct styles of usage.

Hierarchy

Implemented by

Index

Properties

Readonly cache

cache: Record<string, object>

Use to cache arbitrary content associated with this instance. Use for smallish objects that are expensive to compute.

dirty

dirty: boolean

Are there pending changes that need to be flushed?

extension

extension: string

Extension or the empty string if no extension can be determined

Readonly name

name: string

Return file name, excluding path

property

{string} name

Readonly path

path: string

Return file path, with forward slashes

property

{string} path

Methods

flush

  • flush(): Promise<this>

getContent

  • getContent(encoding?: string): Promise<string>

getContentBuffer

  • getContentBuffer(): Promise<Buffer>

getContentSync

  • getContentSync(encoding?: string): string

isBinary

  • isBinary(): Promise<boolean>

isExecutable

  • isExecutable(): Promise<boolean>

isReadable

  • isReadable(): Promise<boolean>

recordAction

rename

  • rename(name: string): Promise<this>

replace

  • replace(re: RegExp, replacement: string): Promise<this>

replaceAll

  • replaceAll(oldLiteral: string, newLiteral: string): Promise<this>

setContent

  • setContent(content: string): Promise<this>

setContentSync

  • setContentSync(content: string): this

setPath

  • setPath(path: string): Promise<this>

Generated using TypeDoc