2.0.12 • Published 2 years ago

pub-src-dropbox v2.0.12

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

pub-src-dropbox

CI

dropbox source for pub-server and pub-generator

  • provides get() and put() for bulk reads and writes
  • works in conjunction with pub-src-fs/fs-base
  • assumes that all files are utf-8 text (does NOT currently handle binary files)
  • globs and descends directories

src(options)

var src = require('pub-src-dropbox');

// instantiate source
// options become properties of source
var source = src(
{ path:'/',
  glob:'*.md' } );

source.get(function(err, files) {
  if (err) return console.log(err);
  console.log(_.pluck(files, 'path'));
});

source.path

  • defaults to '/'

source.glob

source.depth

  • depth limits the depth of directory descent when source.glob includes **/ (globstar)

source.get(cb)

  • get() fetches all matching files in one async operation
  • the result is an array of file objects each with a path: and a text: property
  • the array is sorted alphabetically by path
  • results do not include directories, but do include files in subdirectories
  • if the source is writable, get() is atomic with respect to put() or other source.get() operations
[ { path: '/README.md',
    text: '...' } ]

source.put(files, cb)

  • does nothing unless writable is set on the source
  • stores an array of file objects in a single commit
  • is atomic with respect to source.get() or other source.put() operations
  • returns an array of the paths written
source.put(
  files,
  function(err, result) {
    if (err) return console.log(err);
    console.log(result);
  }
);

configuring access to the pub-server folder on dropbox

To configure access to the pub-server folder on dropbox, set the following variable in your environment (this is requird for running tests)

export DBAC={access code}
2.0.12

2 years ago

2.0.11

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago