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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@weborigami/dropbox

v0.0.4

Published

This package provides functions for treating a [Dropbox](https://www.dropbox.com) folder as an [async tree](https://weborigami.org/async-tree/interface).

Downloads

8

Readme

This package provides functions for treating a Dropbox folder as an async tree.

Obtaining Dropbox credentials

This extension requires an API key from Google. Like most cloud platforms, gaining programmatic access is ridiculously complicated and requires you to navigate a little maze of twisting passages, all different.

As of June 2024, the process to obtain a key is roughly:

  1. Open https://www.dropbox.com/developers.
  2. Click "Create apps".
  3. Fill out the fields to create a new app. As of June 2024, there is only one API choice; "Scoped access". For "type of access you need", select "Full dropbox". Give your app a name. Then click "Create app".
  4. Dropbox will show the settings page for your new app. Click the Permissions tab.
  5. Check the boxes for files.metadata.read and files.content.read, then click Submit to save your changes.
  6. Return to the Settings tab.
  7. In your code editor, create a new file called creds.json, which will store the information you need to connect to Dropbox. In the file, paste:
{
  "app_key": "",
  "app_secret": "",
  "refresh_token": ""
}
  1. Copy the "App key" and "App secret" values from the Dropbox settings page into the corresponding fields in creds.json.
  2. You will now need to jump through several hoops to get a refresh_token. The first step is obtain an "Access Code". Navigate to the following URL, substituting your "App key" from the Dropbox settings page:
https://www.dropbox.com/oauth2/authorize?client_id=<App key>&response_type=code&token_access_type=offline
  1. Dropbox will ask you if you want to grant access to the application; agree to that.
  2. Dropbox should display an Access Code. Copy that value.
  3. You now need to convert that Access Code into a refresh token. In a command window, enter the following command, substituting the "App key", "App secret", and your new "Access code":
curl https://api.dropbox.com/oauth2/token \
    -d code=<Access code> \
    -d grant_type=authorization_code \
    -u <App key>:<App secret>
  1. You should get back a JSON result that contains a refresh_token value like this:
{
  "access_token": "...",
  "token_type": "bearer",
  "expires_in": 14400,
  "refresh_token": "<some string of letters and numbers>",
  ...
}
  1. Copy the refresh_token value from that result and paste it into refresh_token field in the creds.json file.
  2. Add the creds.json file to .gitignore. Don't check credential files into source control!