Published on November 24, 2016 by ProgrammingKnowledge

File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require(‘fs’). All the methods have asynchronous and synchronous forms.

The asynchronous form always takes a completion callback as its last argument. The arguments passed to the completion callback depend on the method, but the first argument is always reserved for an exception. If the operation was completed successfully, then the first argument will be null or undefined.

Leave a Reply

3 Comments on "Node.js Tutorial for Beginners 8 – Reading and Writing Files using fs module"

Notify of
avatar

Siam
Guest
Siam
14 days 2 hours ago

Nice. Make more please. BTW, voice quality / mic improved! 👌

sup7982 GtA
Guest
sup7982 GtA
15 days 14 hours ago

Hi

Vivek Verma (Vipul)
Guest
Vivek Verma (Vipul)
15 days 14 hours ago

Good work.

wpDiscuz