Interface FS

Hierarchy

  • FS

Properties

contains?: ((root: string, file: string) => boolean)

Type declaration

    • (root: string, file: string): boolean
    • check if file is contained in root, always return true by default. Warning: not setting this could expose path traversal vulnerabilities.

      Parameters

      • root: string
      • file: string

      Returns boolean

dirname?: ((file: string) => string)

Type declaration

    • (file: string): string
    • required for relative path resolving

      Parameters

      • file: string

      Returns string

exists: ((filepath: string) => Promise<boolean>)

Type declaration

    • (filepath: string): Promise<boolean>
    • check if a file exists asynchronously

      Parameters

      • filepath: string

      Returns Promise<boolean>

existsSync: ((filepath: string) => boolean)

Type declaration

    • (filepath: string): boolean
    • check if a file exists synchronously

      Parameters

      • filepath: string

      Returns boolean

fallback?: ((file: string) => undefined | string)

Type declaration

    • (file: string): undefined | string
    • fallback file for lookup failure

      Parameters

      • file: string

      Returns undefined | string

readFile: ((filepath: string) => Promise<string>)

Type declaration

    • (filepath: string): Promise<string>
    • read a file asynchronously

      Parameters

      • filepath: string

      Returns Promise<string>

readFileSync: ((filepath: string) => string)

Type declaration

    • (filepath: string): string
    • read a file synchronously

      Parameters

      • filepath: string

      Returns string

resolve: ((dir: string, file: string, ext: string) => string)

Type declaration

    • (dir: string, file: string, ext: string): string
    • resolve a file against directory, for given ext option

      Parameters

      • dir: string
      • file: string
      • ext: string

      Returns string

sep?: string

defaults to "/"

Generated using TypeDoc