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

uppy-angular-demo

v0.1.5

Published

Angular component wrapper around Uppy's officially maintained file uploader. It can be used to easily intigrate uppy in Angular Projects

Downloads

4

Readme

Uppy - Angular

Angular component wrapper around Uppy's officially maintained file uploader. It can be used to easily intigrate uppy in Angular Projects

Uppy is being developed by the folks at Transloadit

Uppy's Official Documentation

NPM Package Link

uppy-angular

Installation

npm i uppy-angular

Demo

Getting started

app.module.ts

import { UppyAngularModule } from 'uppy-angular';

@NgModule({
    imports: [
        UppyAngularModule
        ...
    ],
    ...
})

Component Template

<ng-uppy [config]="settings" (onFileUpload)="onFileUpload($event)"></ng-uppy>

Component TS

import { UppyConfig } from 'uppy-angular';

settings: UppyConfig = {
    uploadAPI: {
    endpoint: environment.apiUrl + 'files/Upload',
    headers: {
        Authorization: 'Bearer ' + localStorage.getItem('userToken')
    }
    },
    plugins: {
        Webcam: true,
        GoogleDrive: true,
        Instagram: true,
        Facebook: true,
        Dropbox: true,
        ScreenCapture:true
    },
    restrictions: {
        maxFileSize: 1000000,
        maxNumberOfFiles: 10,
        minNumberOfFiles: 1
    }
}

Adding style

Add the cdn stylesheet in index.html or download

index.html

<link href="https://transloadit.edgly.net/releases/uppy/v1.21.1/uppy.min.css" rel="stylesheet">

Settings

Input

Output

UppyConfig Description

export interface UppyConfig {
    uploadAPI: {
        destination: string, // backend destination (xhr | tus)
        endpoint: string, // backend endpoint to upload files
        headers?: object // additional headers eg:Authorization Token
    },
    plugins?: {
        companionUrl?: string // null | string - URL to a Companion instance.
        GoogleDrive?: boolean // null | boolean - Allow Uploading Photo From GoogleDrive
        Instagram?: boolean // null | boolean - Allow Uploading Photo From Instagram
        Webcam?: boolean // null | boolean - Allow Taking Photo From Webcam
        Dropbox?: boolean // null | boolean - Allow Uploading Photo From Dropbox
        Facebook?: boolean // null | boolean - Allow Uploading Photo From Facebook
        ScreenCapture?: boolean // null | boolean - Allow Taking ScreenCast
    },
    restrictions?: {
        maxFileSize?: number, //null | number — maximum file size in bytes for each
        maxNumberOfFiles?: number,//null | number — total number of files that can be selected
        minNumberOfFiles?: number,//null | number — minimum number of files that must
        allowedFileTypes?: Array<string> // null | array of wildcards image/*, exact mime types image/jpeg, or file extensions .jpg: ['image/*', '.jpg', '.jpeg', '.png', '.gif']
    },
    statusBarOptions: {
        hideAfterFinish?: boolean //Hide the Status Bar after the upload is complete
        showProgressDetails?: boolean, // By default, progress in Status Bar is shown as a simple percentage. If you would like to also display remaining upload size and time, set this to true.
        hideUploadButton?: boolean, // Hide the upload button. Use this if you are providing a custom upload button somewhere, and using the uppy.upload() API
        hideRetryButton?: boolean, // Hide the retry button in StatusBar
        hidePauseResumeButton?: boolean, // Hide the pause/resume button in StatusBar and on each individual file.
        hideCancelButton?: boolean, // Hide the cancel button in StatusBar and on each individual file.
        hideProgressAfterFinish?: boolean,// Hide Status Bar after the upload has finished
    },
    uploaderLook: {
        theme?: string, // light | dark | auto
        note?: string, // Optionally, specify a string of text that explains something about the upload for the user. This is a place to explain any restrictions that are put in place. 
        proudlyDisplayPoweredByUppy?: boolean, //Uppy is provided to the world for free by the team behind Transloadit. In return, we ask that you consider keeping a tiny Uppy logo at the bottom of the Dashboard, so that more people can discover and use Uppy. This is, of course, entirely optional. Just set this option to false if you do not wish to display the Uppy logo
        width?: number, //null | number — Width of the Dashboard in pixels.
        height?: number, //null | number — Height of the Dashboard in pixels.
        thumbnailWidth?: number, //null | number — Width of the Thumbnail in pixels.
    },
    options?: {
        id?: string, //A site-wide unique ID for the instance.
        debug?: boolean,
        browserBackButtonClose?: boolean
        autoProceed?: boolean, //Setting this to true will start uploading automatically after the first file is selected without waiting for upload button trigger.
        allowMultipleUploads?: boolean, //Setting this to true,  users can upload some files, and then add more files and upload those as well
        meta?: {} //Metadata object, used for passing things like public keys, usernames, tags and so on
    }
}