🚀 Socket Launch Week 🚀 Day 2: Introducing Repository Labels and Security Policies.Learn More
Socket
Sign inDemoInstall
Socket

@blocklet/uploader

Package Overview
Dependencies
Maintainers
2
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocklet/uploader

blocklet upload component

0.1.83
latest
npm
Version published
Weekly downloads
475
-26.92%
Maintainers
2
Weekly downloads
 
Created
Source

@blocklet/uploader

@blocklet/uploader is a package that integrates the uppy service to provide universal upload capability for blocklets. For more information about uppy, refer to the official documentation.

Package Structure

The package is composed of both frontend and backend components. The frontend code resides in the react folder.

Development

Install In Blocklet

# You can use npm / yarn
pnpm add @blocklet/uploader

Install Dependencies

To install the required dependencies, run the following command:

pnpm i

Build Packages

To build the packages, execute the following command:

pnpm build

Build, Watch, and Run Development Server

For building, watching changes, and running the development server, use the following command:

pnpm run dev

Frontend Example

import { lazy } from 'react';

// eslint-disable-next-line import/no-unresolved
const UploaderComponent = lazy(() => import('@blocklet/uploader').then((res) => ({ default: res.Uploader })));

<UploaderComponent
  key="uploader"
  ref={uploaderRef}
  popup
  onUploadFinish={(result) => {
    prependUpload(result.data);
  }}
  plugins={['ImageEditor', 'Url', 'Webcam', canUseUnsplash && 'Unsplash'].filter(Boolean)}
  coreProps={{
    restrictions: {
      allowedFileTypes,
      maxFileSize,
    },
  }}
  apiPathProps={{
    uploader: '/api/uploads',
    companion: '/api/companion',
    disableMediaKitPrefix: false,
    disableAutoPrefix: false,
    disableMediaKitStatus: false,
  }}
/>;

License

This package is licensed under the MIT license.

Keywords

blocklet

FAQs

Package last updated on 18 Apr 2025

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