
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@cloudcmd/dropbox
Advanced tools
Dropbox files and folders CRUD.
npm i @cloudcmd/dropbox --save
All functions requires token as first parameter
stringstringobject can contain:
sort - sort by: name, size, dateorder - "asc" or "desc" for ascending and descending order (default: "asc")type - when "raw" returns not formatted resultconst sort = 'size';
const order = 'desc';
const token = 'token';
const path = '/';
const type = 'raw';
const {readDir} = require('@cloudcmd/dropbox');
const files = await readDir(token, path, {
type,
sort,
order,
});
console.log(files);
// outputs
({
path: '/',
files: [{
name: 'dropbox.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,
}],
});
tokenconst {readFile} = require('@cloudcmd/dropbox');
const readStream = await readFile(token, '/dropbox.html');
readStream.pipe(process.stdout);
tokenconst {writeFile} = require('@cloudcmd/dropbox');
await writeFile(token, '/hello.txt', 'hello');
tokenconst {createReadStream} = require('fs');
const {createWriteStream} = require('@cloudcmd/dropbox');
const token = 'token';
const path = '/file';
const dropboxStream = createWriteStream(token, path);
const localStream = createReadStream(path);
localStream
.pipe(dropboxStream)
.on('error', console
.error)
.on('finish', console.log);
tokenconst {createWriteStream} = require('fs');
const {createReadStream} = require('@cloudcmd/dropbox');
const token = 'token';
const path = '/file';
const dropboxStream = createReadStream(path);
const localStream = createWriteStream(token, path);
dropboxStream
.pipe(localStream)
.on('error', console
.error)
.on('finish', console.log);
remove file/directory.
tokenconst {remove} = require('@cloudcmd/dropbox');
await remove(token, '/fileOrDir');
create directory.
tokenstringconst {mkdir} = require('@cloudcmd/dropbox');
await mkdir(token, '/dirname');
Copy file/directory to new location
tokenfromtoconst {copy} = require('@cloudcmd/dropbox');
await copy(token, '/file1', '/file2');
Move file/directory to new location
tokenfromtoconst {move} = require('@cloudcmd/dropbox');
await move(token, '/file1', '/file2');
readifyMIT
FAQs
dropbox files and folders crud
We found that @cloudcmd/dropbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.