Answers for "file read synchronous in node js"

0

node read file sync

// macOS, Linux, and Windows
fs.readFileSync('<directory>');
// => [Error: EISDIR: illegal operation on a directory, read <directory>]

//  FreeBSD
fs.readFileSync('<directory>'); // => <data>
Posted by: Guest on June-15-2020
0

synchronous file read

const fs = require('fs');
const data = fs.readFileSync('/file.md'); // blocks here until file is read
Posted by: Guest on February-02-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language