njs-examples
njs-examples copied to clipboard
Examples of fs.readSync Use
Are there any good examples of fs.readSync? I already know how to use readFileSync but need to support an alternate use case that reads larger text files (strings) either line by line or blocks of bytes at a time. I've tried a few different implementations of fs.readSync so far but so far it seems like those implementations aren't working. They aren't throwing errors. They're just reading zero bytes at a time. So I was hoping that there were some good code examples that could show how to use that properly.