rethinkdbfs

0.1.0 • Public • Published

RethinkDBFS

A file storage system for RethinkDB inspired by GridFS

The RethinkDBFS spec is being discussed on the RethinkDB slack channel. There WILL be breaking changes.

npm version license


Special thanks to Arthur Andrew Medical for sponsoring this project.

Arthur Andrew Medical manufactures products with ingredients that have extensive clinical research for safety and efficacy. We specialize in Enzymes, Probiotics and Antioxidants.


Installation

Supports node v4.0+

npm install rethinkdbfs

Getting Started

var RethinkDBFS = require('rethinkdbfs')
 
var dbfs = RethinkDBFS({db: 'example'})
 
// prepDB creates tables and indexes if they don't exist, returns a promise.
dbfs.prepDB().then(function () {
  // We are now ready to read and write files
 
  // create read stream from file
  var fileStream = fs.createReadStream('./bigvid.mp4')
 
  // Pipe it to a RethinkDBFS write stream
  fileStream.pipe(dbfs.writeFile({filename: '/videos/bigvid.mp4'}))
 
  fileStream.on('end', function () {
    // File is now written to the database
 
    //Read the file and pipe it to a write stream to save the file back out to the file system.
    dbfs.readFile({filename: '/videos/bigvid.mp4'}).pipe(fs.createWriteStream('./test-bigvid.mp4'))
  })
 
})
 

Readme

Keywords

none

Package Sidebar

Install

npm i rethinkdbfs

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • internalfx