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

@zoibana/fuploader

v0.0.13

Published

Best amazing HTML5 async file uploader plugin

Downloads

4

Readme

FUPloader is a JavaScript library that get rid of typical problems of the standard file upload fields and forms. Yeah, you can use it as regular file field — click in it and choose files from computer. But also you can just drag and drop your files onto the file field! Or JUST COPY IMAGE AND PASTE IT to the file field! FUPloader will display the list of selected files with previews. You can sort files to set order you need, delete files or add new files to list. Then just click UPLOAD button and watch to upload progress of each file in list - one by one. Never before file uploading was so easy and handy!

FUPloader is fully customizable and configurable and can be styled according to your needs.

FUPloader screenshot

FUPloader screenshot

FUPloader uploading screenshot

Quickstart

Install:

$ npm install --save @zoibana/fuploader

Use as ES6 module (recommended):

import Fuploader from "@zoibana/fuploader/Fuploader";

// Base usage
new Fuploader('div#fuploader', {
    upload_url: "/fileupload/",
    name: "file"
});

// With options
new Fuploader(element, {
    upload_url: "/fileupload/", 
    name: "file", // file field name
    lang: "en", // language
    width: 800, // default: 100%
    height: 500, // default: 500px
    sortable: true, // Allow to sort list of selected files. Default false
    paste: true, // Allow to PASTE image files from clipborad
    dragdrop: true, // Allow to select files via drag and drop
    maxFiles: 20, // Max files limit
    maxFileSize: 2, // Max file size in megabytes. If zero — no check. Default: 0
    parallel: true, // Allow parallel files uploading. If false files will upload one by one
    acceptedFileTypes: ['*'], // allowed file mime-types. Etc: ["image.*","text.*"]. If value is empty or equals "*" - no checks
    formData: { // Additional formdata to send with each file. Could be a closure that returns object
      _csrf: "...."
    }
});

// Let's add new locale
Fuploader.lang.ru = {
    upload: 'Загрузить',
    uploadMore: 'Загрузить еще',
    cancel: 'Отмена',
    uploaded: 'Загружен',
    error: 'Ошибка',
    allFilesUploaded: 'Файлы загружены',
    dragFilesHere: 'Перетащите файл сюда',
    chooseFileFromComputer: 'Выберите на компьютере',
    orChooseFileFromComputer: 'Или выберите на компьютере',
    dropFilesHere: 'Бросьте файл в эту область',
    totalSize: 'Общий вес',
    selectedFiles: 'Выбрано файлов',
    maxFilesLimitReached: 'Уже выбрано максимально разрешенное кол-во файлов',
    fileTypeIsNotAllowed: 'Формат файла не разрешен',
    fileIsTooBig: 'Файл слишком тяжелый. Макс вес: {{maxFilesize}}',
};

// And use it
new Fuploader(element, {
    upload_url: "/fileupload/",
    lang: "ru", // language
});

SCSS

@import '@zoibana/fuploader/dist/css/fuploader.css';

Not using a package manager or bundler?

Use the standalone files like this:

<script src="https://unpkg.com/@zoibana/[email protected]/dist/js/Fuploader.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@zoibana/[email protected]/dist/css/fuploader.css" type="text/css"/>

<div id="fuploader"></div>

<script>
  new Fuploader('#fuploader', { upload_url: "/fileupload/" });
</script>

🔥 Main features

  • Lightweight: 61 kb JS + 4 kb CSS
  • Image thumbnail previews
  • Multiple files and one by one or synchronous uploads
  • Progress updates
  • Sortable list of selected files
  • Customizable by css