object-stream-to-fs

Stream objects to a file and store it to be read from JSONStream

#object-stream-to-fs

Consume a stream of objects and save them to a file.

Specify a path to the target file.

example

save objects to a file:

var s = objectStreamToFS('/tmp/test-file');
 
var d = dump('mongodb://127.0.0.1/test_db', 'testcollection');
 
d.pipe(s);
 
s.on('done', function(){
  console.log("the object stream has been consumed!")
});
 

methods

var objectStreamToFS = require('object-stream-to-fs')

Consume the entire stream of objects.

The returned object s is a Stream.

events

Emitted when all writes have been completed and the object stream has been consumed.

install

With npm do:

npm install object-stream-to-fs

license

MIT