Function readFileIfExists

  • 读取文件,如果文件不存在则返回null Default use { encoding: 'utf-8' } as options

    Parameters

    • fileName: string

      filename or file descriptor

    • options: undefined | {
          encoding: BufferEncoding;
          flag?: string;
      } = ...

      Options for reading the file

    Returns null | string

    string if options.encoding is specified, otherwise Buffer

Generated using TypeDoc