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

s3-frontend-pusher

v1.0.4

Published

aws s3 (pipeline) tool to wipe a bucket and deploy a fresh frontend on top without having to install python and awscli deps. inside a pipeline

Downloads

12

Readme

s3-frontend-pusher

This npm package wipes a specified bucket and pushes contents from a directory provided by a user to aws s3. It is intended to be used with small frontends (read the caveats please) and was motiviated by the fact that we had to install nodejs npm python and awscli in every pipeline thus making required docker build images larger than alpines and taking longer to build in total.

How to use:

  1. install the package
npm i -g s3-frontend-pusher
  1. use the package in one line
s3-frontend-pusher --key=KEY --secret=SECRET --src=folder --bucket=BUCKET

or create a config file like so:

touch .s3-frontend-pusher

This file needs to be in the folder where you make use of the command. It should be structured in this exact manner:

KEY
SECRET
BUCKET
ENDPOINT
S3FORCEPATHSTYLE
  • So line 1 has to be present and it has to be the ACCESS_KEY_ID
  • Line 2 has to be present and it has to be the SECRET_KEY
  • Line 3 has to be present and it has to be the bucket name
  • Line 4 is optional. This is required if you want to do offline uploading against something like localstack or serverless-offline.
  • Line 5 is optional. Gets activated only if you put in "true" (without the quotes). This property is required if you want to force the path style. So bucketname.hostname.domain becomes hostname.domain/bucketname. We need to activate this to use localstack. Configurating a different endpoint than the aws requires you to create a config file by the way.

If you have created a .s3-frontend-pusher file you can run the command omitting most parameters:

s3-frontend-pusher --src=folder

CAVEATS

Only works if the bucket content has less than 1000 files. This is due to AWS setting the list-limit to 1000. So there is room for improvement to implement a recursive way to check whether there are still files left inside the bucket or not!

TODOS

  • I hate the way we pass the commandline args at the moment and I need to find a shorter way.
  • Momentarily uploads happen with ACL: public-read hardcoded. I would like to add plain public to the cli to make this configurable.