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

vue-pony-uploader

v0.0.47

Published

Vue component for uploading images directly to Amazon S3 or Google Cloud Storage via a signed url. Optional config for tracking and persisting images and metadata (see ./example/server)

Downloads

50

Readme

vue-pony-uploader

Pony uploader is a simple drag & drop image uploader which will send image directly to Amazon S3 or Google Cloud Storage using a signed url, based on your configuration.

This project contains a server component which will work well with express, a client side component, and a full example project. Pony-uploader uses several HTML5 features and will probably not work on older browsers.

What is a signed URL?

"A signed URL is a URL that provides limited permission and time to make a request. Signed URLs contain authentication information in their query string, allowing users without credentials to perform specific actions on a resource. When you generate a signed URL, you specify a user or service account which must have sufficient permission to make the request that the signed URL will make. After you generate a signed URL, anyone who possesses it can use the signed URL to perform specified actions, such as reading an object, within a specified period of time." - Google

  • Google Cloud Storage
  • Amazon S3

Getting Started

Follow the steps below to quickly have the image loader component running within your Vue application.

Install

npm i vue-pony-uploader --save

Usage

If you have a staging and production environment for your api endpoints, consider using an environment variable for the base-url as shown below.

<!-- component.vue -->
<vue-image-upload
	v-model="image"
	ref="uploader"
	placeholder-image-url=""
	:base-url="`${VUE_APP_PONY_UPLOADER_HOST}`"
></vue-image-upload>
// component.js
import VueImageUpload from 'vue-pony-uploader'
Vue.component('vue-image-upload', VueImageUpload)

const vue = new Vue({
  el: '#app',
  components: { App },
  template: '<App/>'
})
export { vue as Vue }

Options

Since the component provides the ability to optionally track image metadata with a backend of your choice, there are many options available.

| key | type | default | required | |:--------------------:|:-------:|:------------:|:--------:| | base-url | String | N/A | Yes | | signature-url | String | /signature | No | | index-url | String | /index | No | | bucket | String | images | No | | track-image-status | Boolean | false | No | | width | Number | 200 | No | | height | Number | 200 | No | | imageWidth | Number | 200 | No | | imageHeight | Number | 200 | No | | jpgQuality | Number | 1 | No | | imageBackgroundColor | String | #9ff | No |

Setup and Run Demo

Follow the steps below to have the example Vue application and example server up and running quickly.

Setup Amazon S3 or Google Cloud Storage

NOTE: The example server is meant to be an example and should not be considered production ready. The /signature endpoint will fetch a signed url once you have provided your cloud credentials. However, the /index endpoints for optional image tracking is only stubbed out. It is up to you to implement them should you want to track whether the image ends up getting used or will become stale.

Details on setting up your server can be found here

NOTE: The example server provides the functionality for obtaining a signed url from Amazon S3 or Google provided only has the index endpoints stubbed out. It is up to you to implement them should you want to track whether the image ends up getting used or will become stale.

Run with Docker

$ git clone https://github.com/ponycode/pony-uploader
$ cd pony-uploader/example
$ docker-compose up

Navigate to http://localhost:3001

Run without Docker

$ git clone https://github.com/ponycode/pony-uploader
$ cd pony-uploader/example/server
$ npm install
$ npm start
$ cd .. && cd client-demo
$ npm install
$ npm run serve 

Navigate to http://localhost:8080

License

Copyright (c) 2015 Joshua Kennedy Licensed under the MIT license.