Skip to content
A node-task RecordIO interface for local filesystems.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.jshintrc
Gruntfile.js
LICENSE
README.md
package.json

README.md

recordio-file

A node-task RecordIO interface for local filesystems.

API

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');

recordio.read('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>>
});
Something went wrong with that request. Please try again.