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

dpd-s3

v0.3.1

Published

get a signed Url for Put, Get file in AWS S3 in deployd

Downloads

57

Readme

dpd-s3

npm

Description

deployd module that generate AWS S3 signedUrl. You can HTTP PUT/GET/DELETE files via the signedUrl from s3 storage.

Getting started

This module requires deployd ~0.7.0.

If you haven't used Deployd before, make sure to read the documentation.

Installation without package.json

npm install dpd-s3

Installation with package.json

If you have a package.json, you'll have to add this module in it.

npm install dpd-s3 --save

Once it is installed, Deployd will automatically load it.
For more information about Modules, take a look at the module page on the deployd documentation.

The dpd-s3 module

Overview

It is a simple aws-sdk wrapper for deployd

Options/Settings

Require:

  • AWS Access Key
  • AWS Access Secret
  • S3 Region
  • S3 bucket

Please fill them in using the deployd dashboard config page of this module.

Usage example

Using dpd.js

Dpd-s3 request a Signed URL to allow uploading/downloading a file.

Request a Signed URL to upload a file named 'apple.jpg'

dpd.s3bucket.get('apple.jpg', {
    signedUrl: 'Put'
    ContentType: 'image/jpeg'
}, function(signedUrl, err){

    // regular http put file to signedUrl
    $.ajax({type:'Put', url:signedUrl}, ...);

})

Request a Signed URL to download a file named 'apple.jpg'

<img src="/s3bucket/apple.jpg" />

OR

dpd.s3bucket.get('apple.jpg', {
    returnFormat: 'Url'
}, function(signedUrl, err){
    console.log(signedUrl);
})

Delete file names 'apple.jpg'

dpd.s3bucket.delete('apple.jpg', function(ret, err){
    console.log(ret, err);
})

Using HTTP Requests

Request a Signed URL to upload a file named 'apple.jpg'. Then do a PUT request to the returned URL with your file in parameter, dont forget to set the proper header 'Content-Type' for this request too.

GET http://localhost:2403/my-bucket/apple.jpg?ContentType=image/jpeg&signedUrl=Put

Request a Signed URL to download a file named 'apple.jpg'

GET http://localhost:2403/my-bucket/apple.jpg?returnFormat=Url

Delete file names 'apple.jpg'

DELETE http://localhost:2403/my-bucket/apple.jpg

Contributing

Just send me a Pull Request in Github.

Release history

  • 0.1.0: refactor to use aws-sdk and signedUrl instead of direct upload

Contributors

Eric Fong cowgp dallonf