recordio-file

A node-task RecordIO interface for local file systems.

recordio-file

A node-task RecordIO interface for local filesystems.

Read a file from the local filesystem and return a promise which resolves to a node-task Record representing it.

The options object supports these keys:

  • encoding The encoding of the file to be read.
var recordio = require('recordio-file');
 
recordio.read('test/fixtures/foo.txt', { encoding: 'utf8' }).then(function (self) {
  console.log(self) // <Record "test/fixtures/foo.txt" <Buffer 66 6f 6f>> 
});

Save a node-task Record to the local filesystem.

The options object supports these keys: n/a

var Record = require('record');
var recordio = require('recordio-file');
 
var record = new Record('tmp/test.txt', 'utf8', 'test file');
recordio.write(record).then(function(self) {
  console.log(self); // <Record "tmp/test.txt" <Buffer 74 65 73 74 20 66 69 6c 65>> 
});