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

react-image-upload-interface

v1.1.6-b

Published

A simple image upload interface for react

Downloads

3

Readme

Image Uploader

  • A simple image uploading interface for React

Installation

npm i react-image-upload-interface
import { ImageUploader } from 'react-image-upload-interface'

Usage

  <ImageUploader
    Width='80vh'
    Height='60vh'
    submitButtonStyle={submitButtonStyle}
    handleFileSubmit={handleFileSubmit}
  />

Required Props

  • Use the Width and Height props to specify the width and height of the component
  • To access an array of submitted files, it's important to pass in a handleFileSubmit callback function:
  handleFileSubmit = (files) => /* code to handle raw image files */

Optional Props

  • Use the uploadButtonStyle and submitButtonStyle props to style the respective buttons
  • The MaxResolution and MaxFileSize props specify the level of compression each image incurs. By default, images have a max height or width of 1920px and a max file size of 1mb

How It Works

  • This image upload interface accepts the uploading of .png, .jpg, and .jpeg files
  • Users can swap the position of the images by using drag-and-drop, and this order will be reflected upon submission
  • Users can delete images from the list
  • Uploading the same image name will not produce a second copy of that image to appear

Under The Hood

  • Swapping of image positions is handled using in-line styles, requiring only the two individual images to be re-rendered in constant time
  • Once uploaded, images are compressed to improve browser performance
    • A reference to the raw image file is retained in memory via a hashmap
    • Compression is handled asynchronously, and a loading spinner is provided for user feedback
  • Upon submission, the individual images in the DOM are references for their order and applied to the raw files in memory, requiring only a single linear runtime operation

Contributions

  • Authored by Stephen Rivas
  • To contribute to this repo:
    • fork, clone and submit a feature branch as a pull request