We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
For anyone using modern browsers/node, this should help to make the examples usable.
The secret lies in util.promisify!
const util = require('util') const dbAccessToken = 'YOURTOKEN' const dropbox = require('dropbox-v2-api').authenticate({ token: dbAccessToken }) const dbSync = util.promisify(dropbox) async function getAcc () { const params = { resource: 'users/get_current_account' } try { return (await dbSync(params)) } catch (err) { console.error(err) } } async function test () { console.log(await getAcc()) } test()
Hope this helps someone else avoid a good couple of hours struggling with why the "returns" were returning" undefined"!