* Reads the entire file synchronously. * @param {object|string} [options] Options or encoding * @returns {Buffer|string}
(options)
| 570 | * @returns {Buffer|string} |
| 571 | */ |
| 572 | readFileSync(options) { |
| 573 | this.#checkClosed('read'); |
| 574 | this.#checkReadable(); |
| 575 | |
| 576 | // Get content (resolves dynamic content providers) |
| 577 | const content = this.content; |
| 578 | const encoding = typeof options === 'string' ? options : options?.encoding; |
| 579 | if (encoding) { |
| 580 | return content.toString(encoding); |
| 581 | } |
| 582 | return Buffer.from(content); |
| 583 | } |
| 584 | |
| 585 | /** |
| 586 | * Reads the entire file. |
nothing calls this directly
no test coverage detected