{"id":18483291,"url":"https://github.com/cloudcmd/dropbox","last_synced_at":"2025-04-08T18:32:35.703Z","repository":{"id":57102598,"uuid":"120770601","full_name":"cloudcmd/dropbox","owner":"cloudcmd","description":"dropbox files and folders crud","archived":false,"fork":false,"pushed_at":"2024-03-16T16:41:14.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T13:46:33.680Z","etag":null,"topics":["cloudcmd","crud","directory","dropbox","flask","javascript","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudcmd.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"coderaiser","patreon":"coderaiser","open_collective":"cloudcmd","ko_fi":"coderaiser"}},"created_at":"2018-02-08T14:18:30.000Z","updated_at":"2024-03-16T13:18:17.000Z","dependencies_parsed_at":"2024-06-19T10:00:30.608Z","dependency_job_id":"0236ae98-4431-4e1a-9bff-489646d9a6b2","html_url":"https://github.com/cloudcmd/dropbox","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fdropbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fdropbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fdropbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fdropbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudcmd","download_url":"https://codeload.github.com/cloudcmd/dropbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902512,"owners_count":21015462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudcmd","crud","directory","dropbox","flask","javascript","nodejs"],"created_at":"2024-11-06T12:35:14.208Z","updated_at":"2025-04-08T18:32:30.693Z","avatar_url":"https://github.com/cloudcmd.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coderaiser","https://patreon.com/coderaiser","https://opencollective.com/cloudcmd","https://ko-fi.com/coderaiser"],"categories":[],"sub_categories":[],"readme":"# Dropbox [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@cloudcmd/dropbox.svg?style=flat\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]: https://npmjs.org/package/@cloudcmd/dropbox \"npm\"\n[BuildStatusURL]: https://github.com/cloudcmd/dropbox/actions?query=workflow%3A%22Node+CI%22 \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/cloudcmd/dropbox/workflows/Node%20CI/badge.svg\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n[CoverageURL]: https://coveralls.io/github/cloudcmd/dropbox?branch=master\n[CoverageIMGURL]: https://coveralls.io/repos/cloudcmd/dropbox/badge.svg?branch=master\u0026service=github\n\nDropbox files and folders CRUD.\n\n## Install\n\n```\nnpm i @cloudcmd/dropbox --save\n```\n\n## API\n\nAll functions requires [token](https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/) as first parameter\n\n### readDir(token, path[, options])\n\n- **token** - `string`\n- **path** - `string`\n- **options** - `object` can contain:\n  - `sort` - sort by: name, size, date\n  - `order` - \"asc\" or \"desc\" for ascending and descending order (default: \"asc\")\n  - `type` - when \"raw\" returns not formatted result\n\n#### Example\n\n```js\nconst sort = 'size';\nconst order = 'desc';\nconst token = 'token';\nconst path = '/';\nconst type = 'raw';\n\nconst {readDir} = require('@cloudcmd/dropbox');\n\nconst files = await readDir(token, path, {\n    type,\n    sort,\n    order,\n});\n\nconsole.log(files);\n// outputs\n({\n    path: '/',\n    files: [{\n        name: 'dropbox.js',\n        size: 4735,\n        date: 1_377_248_899_000,\n        owner: 0,\n        mode: 0,\n    }, {\n        name: 'readify.js',\n        size: 3735,\n        date: 1_377_248_899_000,\n        owner: 0,\n        mode: 0,\n    }],\n});\n```\n\n### readFile(token, path)\n\n- **token** - `token`\n- **path** - path to file\n\n#### Example\n\n```js\nconst {readFile} = require('@cloudcmd/dropbox');\n\nconst readStream = await readFile(token, '/dropbox.html');\nreadStream.pipe(process.stdout);\n```\n\n### writeFile(token, path, contents)\n\n- **token** - `token`\n- **path** - path to file\n- **contents** - contents of a file\n\n#### Example\n\n```js\nconst {writeFile} = require('@cloudcmd/dropbox');\n\nawait writeFile(token, '/hello.txt', 'hello');\n```\n\n### createWriteStream(token, path)\n\n- **token** - `token`\n- **path** - path to file\n\n#### Example\n\n```js\nconst {createReadStream} = require('fs');\nconst {createWriteStream} = require('@cloudcmd/dropbox');\n\nconst token = 'token';\nconst path = '/file';\n\nconst dropboxStream = createWriteStream(token, path);\nconst localStream = createReadStream(path);\n\nlocalStream\n    .pipe(dropboxStream)\n    .on('error', console\n        .error)\n    .on('finish', console.log);\n```\n\n### createReadStream(token, path)\n\n- **token** - `token`\n- **path** - path to file\n\n#### Example\n\n```js\nconst {createWriteStream} = require('fs');\nconst {createReadStream} = require('@cloudcmd/dropbox');\n\nconst token = 'token';\nconst path = '/file';\n\nconst dropboxStream = createReadStream(path);\nconst localStream = createWriteStream(token, path);\n\ndropboxStream\n    .pipe(localStream)\n    .on('error', console\n        .error)\n    .on('finish', console.log);\n```\n\n### remove(token, path)\n\nremove file/directory.\n\n- **token** - `token`\n- **path** - path to file\n\n#### Example\n\n```js\nconst {remove} = require('@cloudcmd/dropbox');\n\nawait remove(token, '/fileOrDir');\n```\n\n### mkdir(token, path)\n\ncreate directory.\n\n- **token** - `token`\n- **path** - `string`\n\n#### Example\n\n```js\nconst {mkdir} = require('@cloudcmd/dropbox');\n\nawait mkdir(token, '/dirname');\n```\n\n### copy(token, from, to)\n\nCopy file/directory to new location\n\n- **token** - `token`\n- **from** - path `from`\n- **to** - path `to`\n\n#### Example\n\n```js\nconst {copy} = require('@cloudcmd/dropbox');\n\nawait copy(token, '/file1', '/file2');\n```\n\n### move(token, from, to)\n\nMove file/directory to new location\n\n- **token** - `token`\n- **from** - path `from`\n- **to** - path `to`\n\n#### Example\n\n```js\nconst {move} = require('@cloudcmd/dropbox');\n\nawait move(token, '/file1', '/file2');\n```\n\n## Related\n\n- [readify](https://github.com/coderaiser/readify \"readify\") - read directory content with file attributes: size, date, owner, mode\n- [flop](https://github.com/coderaiser/flop \"flop\") - FoLder OPerations\n- [dropboxify](https://github.com/coderaiser/dropboxify \"dropboxify\") - read directory content from dropbox compatible way with `readify`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcmd%2Fdropbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudcmd%2Fdropbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcmd%2Fdropbox/lists"}