fs.readFileSync(path[, options])


    返回 path 的内容。

    Returns the contents of the path.

    For detailed information, see the documentation of the asynchronous version of this API: fs.readFile().

    If the encoding option is specified then this function returns a string. Otherwise it returns a buffer.

    Similar to fs.readFile(), when the path is a directory, the behavior of fs.readFileSync() is platform-specific.

    import { readFileSync } from 'node:fs';
    
    // macOS, Linux, and Windows
    readFileSync('<directory>');
    // => [Error: EISDIR: illegal operation on a directory, read <directory>]
    
    //  FreeBSD
    readFileSync('<directory>'); // => <data>