node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



A node-task RecordIO interface for local filesystems.


read(path, options)

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');'test/fixtures/foo.txt', { encoding: 'utf8' }).then(function (self) {
  console.log(self) // <Record "test/fixtures/foo.txt" <Buffer 66 6f 6f>> 

write(record, options)

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>>