How to use fstream

Comprehensive fstream code examples:

How to use fstream.Writer:

144
145
146
147
148
149
150
151
152
if (!fs.existsSync(self.path))
  wrench.mkdirSyncRecursive(self.path);

// Copy everything over
var reader = fstream.Reader(self.sourcePath);
var writer = fstream.Writer(self.path);

// Ok fs copy is done
writer.on('close', function() {

How to use fstream.Reader:

143
144
145
146
147
148
149
150
151
152

if (!fs.existsSync(self.path))
  wrench.mkdirSyncRecursive(self.path);

// Copy everything over
var reader = fstream.Reader(self.sourcePath);
var writer = fstream.Writer(self.path);

// Ok fs copy is done
writer.on('close', function() {