Home > Article > Web Front-end > Instructions for using the fs.readFileSync method in node.js_node.js
Method description:
Synchronized version of fs.readFile().
Grammar:
Since this method belongs to the fs module, the fs module needs to be introduced before use (var fs= require(“fs”) )
Receive parameters:
filename file path
options option object, including encoding, encoding format, this item is optional.
Example: