Install via npm
$ npm install disk-dropbox
var Dropbox = require( 'disk-dropbox' )
// Create a volume with your credentials
var volume = new Dropbox.Volume({
key: 'xxxxxxxxxxxxxxx',
secret: 'xxxxxxxxxxxxxxx',
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
uid: '00000000'
})
// Initialize the volume
volume.init( function( error ) {
if( error ) { handleError( error ) }
// You're authenticated now, and `volume.fs`
// has node fs module compatible API (see 'disk-fs' module)
volume.fs.readdir( '/', function( error, entries ) {
console.log( 'readdir', entries )
})
})