New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@idsync/dropbox-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idsync/dropbox-client

Dropbox client library

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
8
700%
Maintainers
1
Weekly downloads
 
Created
Source

Dropbox Client

Dropbox client library for Idsync

Installation

Simply run npm install @idsync/dropbox-client --save to install.

Usage

Use the createClient method to create a client interface:

const { createClient } = require("@idsync/dropbox-client");

const client = createClient("my-token");

You can then use the client adapter to make requests like for directory contents:

client
    .getDirectoryContents("/Documents")
    .then(contents => {
        // [ {
        //     name: "My directory",
        //     path: "/Documents/My directory",
        //     type: "directory"
        // }, {
        //     name: "results.pdf",
        //     path: "/Documents/results.pdf",
        //     type: "file"
        // } ]
    });

You can also read and write files using getFileContents and putFileContents, respectively. Check out the API documentation for more information.

Fs

An fs-like interface is also available:

const { createClient, createFsInterface } = require("@idsync/dropbox-client");

const client = createClient("my-token");
const dfs = createFsInterface(client);

dfs.readdir("/photos", (err, items) => {
    // array of file names
});

Read the fs API documentation for more information on the available methods.

Keywords

dropbox

FAQs

Package last updated on 29 Jan 2021

Did you know?

Socket

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.

Install

Related posts