dropbox read directory or file
npm install readbox[NPMIMGURL]: https://img.shields.io/npm/v/readbox.svg?style=flat
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/readbox "npm"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/readbox?branch=master
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/readbox/badge.svg?branch=master&service=github
[BuildStatusURL]: https://github.com/coderaiser/readbox/actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/readbox/workflows/Node%20CI/badge.svg
Read file or directory from dropbox.
```
npm i readbox
readbox requires token as first parameter
- token - stringstring
- path - object
- options - can contain:sort
- - sort by: name, size, dateorder
- - "asc" or "desc" for ascending and descending order (default: "asc")type
- - when "raw" returns not formatted resultroot
- - root directory to cut from resultfunction
- fn - callback
#### Example
`js
const sort = 'size';
const order = 'desc';
const token = 'token';
const path = '/';
const type = 'raw';
const readbox = require('readbox');
const stream = await readbox(token, path, {
type,
sort,
order,
});
console.log(stream.type);
// outputs
'directory';
stream.pipe(process.stdout);
// outputs
({
path: '/',
files: [{
name: 'readbox.js',
size: 4735,
date: 1_377_248_899_000,
owner: 0,
mode: 0,
}, {
name: 'readify.js',
size: 3735,
date: 1_377_248_899_000,
owner: 0,
mode: 0,
}],
});
const stream2 = await readbox(token, '/dropbox.html');
console.log(stream2.type);
// outputs
'file';
stream.pipe(process.stdout);
`
- readify - read directory content with file attributes: size, date, owner, mode
- flop - FoLder OPerations
- dropboxify - read directory content from readbox compatible way with readify`
- dropbox - Dropbox files and folders CRUD
MIT