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

dropbox-file-picker

v1.0.9

Published

Custom file/folder chooser for Dropbox API

Downloads

65

Readme

dropbox-file-picker

Simple Dropbox chooser replacement (files and folders picker) with browser and Electron support.

List layout example:

alt text

Grid layout example:

alt text

Features:

  • Independent from default Dropbox chooser
  • Without using of external window or iframe
  • Supports image files previews
  • Ability to select multiple files & folders at the same time
  • Supports grid and list layout modes
  • Localization support
  • Adjustable grid layout columns count

Installation:

npm i dropbox-file-picker

Notes:

  • Currently works only as modal window
  • No ability to upload files/authorize/create folders (will be implemented later)

Usage:

Minimal setup:
import dropboxPicker from 'dropbox-file-picker';

dropboxPicker.open({ accessToken: 'dropbox_access_token_here' }) // user's accessToken
    .then(result => onSuccess(result)); // promise with selected files/folders info
Advanced setup:
import dropboxPicker from 'dropbox-file-picker';

dropboxPicker.open({
    accessToken: 'dropbox_access_token_here', // user's accessToken
    allowedExtensions: extensions, // like ['png', 'jpg', '.gif'] (with or without dot)
    allowFolderSelection: false, // folder selection 
    isMultiple: true, // multiple entries (files/folders) selection
    loadPreviews: true, // load preview for supported image formats ('jpg', 'jpeg', 'png', 'tiff', 'tif', 'gif', 'bmp')
    hideCountLabel: false, // show or hide label 'You've selected * entries' (defaults to 'false')
    hideCheckboxes: false, // hide checkboxes (defaults to 'false')
    rows: 4, // rows count in grid mode (defaults to 4, min 1, max 10)
    defaultLayout: 'list', // layout mode (defaults to 'list', supported values: 'list', 'grid')
    disableLayoutSelection: true, // ability to select layout mode (defaults to 'false')
    width: '700px', // custom width (defaults to '50%', supported values: any css width value)
    previewSettings: {
        size: 'w256h256', // preview size (default "w64h64")
    },
    localization: { // translation values
        title: 'Dropbox', // main title
        cancel: 'Cancel', // cancel button
        choose: 'Choose', // choose button
        entriesSelectionLabel: 'You\'ve selected {0} entries' // entries selection label
    }
})
.then(
    result => onSuccess(result), // promise with selected files/folders info
    result => onClose(result) // promise on window selection cancel
);

Supported previews size: w32h32 w64h64 w128h128 w256h256 w480h320 w640h480 w960h640 w1024h768 w2048h1536

Response format example:
[
    {
        .tag: "folder"
        id:  <folder_id>
        name: <folder_name>
        path_display: <full_folder_path>
        path_lower: <full_folder_path_lowercase>
    },
    {
        .tag: "file"
        client_modified: <iso_timtestamp>
        content_hash: <content_hash>
        id: <file_id>
        is_downloadable: <bool_is_downloadable>
        name: <string_file_name_with_extension>
        path_display: <full_file_path>
        path_lower: <full_file_path_lowercase>
        rev: <rev_id>
        server_modified: <iso_timtestamp>
        size: <number_file_size>
        thumbnailUrl: <string_base64_thumbnail>
    }
]