It stores each element as a key-value pair where keys are weakly referenced. If you need to specify the character encoding then here is the way you'll need to call the method: fs.
Between serializing and deserializing, the string representing the object may have been stored in a file or data, or sent over a network connection to some distant machine.
The simplest way, and often the most appropriate, is to use the writeFile method in the fs module.
based on 46 review