npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dropbox-promise

v0.0.4

Published

Dropbox REST API Promise Wrapper

Readme

Dropbox Promise

A simple Dropbox promise wrapper.

Installation

npm install --save dropbox-promise

Usage

Before starting anything you need to go create your app over at: https://www.dropbox.com/developers/apps then go ahead and grab your Key and Secret.

Include

Add the following to the top of your project (with the other dependencies):

const dropbox = require('dropbox-promise');
const key = ""; //Dropbox API Key
const secret = ""; //Dropbox API Secret Key
const redirect_url = ""; //URL that the user will be sent to after Dropbox authentication

Authentication

First you must generate a URL for the user to be redirected to.

dropbox.authenticate(key, redirect_url)
    .then(function(url) {
      //Returns a URL to redirect the user to.
    })
    .catch(function(error) {
      //Do something with the error.
    });

When the user has authenticated, they will be returned to the callback URL supplied with an authentication code. We need to turn this into an access code.

dropbox.accessToken(key, secret, authentication_code, redirect_url) //authentication_code is supplied by dropbox after user authentication
  .then(function(result) {
    //Returns the users access_token.
    let access_token = result.access_token;
  })
  .catch(function(error) {
    //Do something with the error.
  });

API

To use the API, you must create an API object:

let api = dropbox.api( access_token );

This gives us access to various functions. Here's an example of how to use this:

let api = dropbox.api( access_token );

api.unlink() //Unlink our application from the users Dropbox account
    .then(function(result) { //result if any returned
      //Success
    })
    .catch(function(error) {
      //Do something with the error.
    });

Available APIs

api.unlink() //Unlinks our application from the users Dropbox account
api.account() //Returns information about the users account
api.storage() //Returns information regarding the users storage. How much they have and how much they've used
api.createFolder(path) //Create a folder in the users Dropbox (in our application folder if set up that way)
api.listFolder(path, recursive, include_media_info, include_deleted, include_has_explicit_shared_members, include_mounted_folders) //List the contents of a folder. All are optional except path
api.getThumbnail(path, format, size) //Get a thumbnail for a file. Returns a downloaded image. All are optional except path