You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

filepond

Package Overview
Dependencies
0
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

filepond

FilePond, Where files go to stretch their bits.


Version published
Maintainers
1
Created

Package description

What is filepond?

FilePond is a JavaScript library that allows you to upload files with a sleek, customizable interface. It supports multiple file uploads, image previews, drag-and-drop functionality, and integrates well with various frameworks like React, Vue, and Angular.

What are filepond's main functionalities?

Basic File Upload

This code snippet demonstrates how to create a basic file upload interface using FilePond. It initializes FilePond on an input element of type 'file'.

<script>
  const inputElement = document.querySelector('input[type="file"]');
  const pond = FilePond.create(inputElement);
</script>

Image Preview

This code snippet shows how to add image preview functionality to the file upload interface. It registers the Image Preview plugin and initializes FilePond on an input element.

<script>
  FilePond.registerPlugin(FilePondPluginImagePreview);
  const inputElement = document.querySelector('input[type="file"]');
  const pond = FilePond.create(inputElement);
</script>

Drag and Drop

This code snippet demonstrates how to enable drag-and-drop functionality for file uploads. It initializes FilePond with options to allow dropping files on the page or on the file input element.

<script>
  const pond = FilePond.create(
    document.querySelector('input[type="file"]'),
    {
      dropOnPage: true,
      dropOnElement: true
    }
  );
</script>

Server Integration

This code snippet shows how to integrate FilePond with a server endpoint for handling file uploads. It initializes FilePond with a server option pointing to the API endpoint.

<script>
  const pond = FilePond.create(
    document.querySelector('input[type="file"]'),
    {
      server: '/api'
    }
  );
</script>

Other packages similar to filepond

Changelog

Source

4.31.1

  • Fix issue with dragging file items sometimes not working.

Readme

Source

FilePond

A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.

License: MIT npm version npm minzipped size

FilePond adapters are available for React, Vue, Angular, Svelte, and jQuery


FilePond

Buy me a Coffee / Use FilePond with Pintura / Dev updates on Twitter


Core Features

  • Accepts directories, files, blobs, local URLs, remote URLs and Data URIs.
  • Drop files, select on filesystem, copy and paste files, or add files using the API.
  • Async uploads with AJAX, supports chunk uploads, can encode files as base64 data and send along form post.
  • Accessible, tested with AT software like VoiceOver and JAWS, navigable by Keyboard.
  • Image optimization, automatic image resizing, cropping, filtering, and fixes EXIF orientation.
  • Responsive, automatically scales to available space, is functional on both mobile and desktop devices.

Learn more about FilePond


Also need Image Editing?

Pintura the modern JavaScript Image Editor is what you're looking for. Pintura supports setting crop aspect ratios, resizing, rotating, cropping, and flipping images. Above all, it integrates beautifully with FilePond.

Learn more about Pintura


FilePond Plugins

Adapters

Backend

Quick Start

Install using npm:

npm install filepond

Then import in your project:

import * as FilePond from 'filepond';

// Create a multi file upload component
const pond = FilePond.create({
    multiple: true,
    name: 'filepond'
});

// Add it to the DOM
document.body.appendChild(pond.element);

Or get it from a CDN:

<!DOCTYPE html>
<html>
<head>
  <title>FilePond from CDN</title>

  <!-- Filepond stylesheet -->
  <link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet">

</head>
<body>

  <!-- We'll transform this input into a pond -->
  <input type="file" class="filepond">

  <!-- Load FilePond library -->
  <script src="https://unpkg.com/filepond/dist/filepond.js"></script>

  <!-- Turn all file input elements into ponds -->
  <script>
  FilePond.parse(document.body);
  </script>

</body>
</html>

Getting started with FilePond

Internationalization

The locale folder contains different language files, PR's are welcome, you can use locale files like this:

import pt_BR from 'filepond/locale/pt-br.js';

FilePond.setOptions(pt_BR);

Contributing

At the moment test coverage is not great, it's around 65%. To accept pull requests the tests need to be better, any help to improve them is very much appreciated.

Tests are based on Jest and can be run with npm run test

To build the library run npm run build

Publications

Browser Compatibility

FilePond is compatible with a wide range of desktop and mobile browsers, the oldest explicitly supported browser is IE11, for best cross browser support add FilePond Polyfill and Babel polyfill to your project.

FilePond uses BrowserStack for compatibility testing.

BrowserStack

License

Please don't remove or change the disclaimers in the source files

MIT License

Copyright (c) 2020 PQINA | Rik Schennink

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 12 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc