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

newsapps-deploy

v1.0.0

Published

A collection of awscli-powered deploy scripts that can be easily reused.

Downloads

4

Readme

newsapps-deploy

A collection of awscli-powered deploy scripts that can be easily reused.

Requirements

Installation

npm install --save-dev newsapps-deploy

Usage

newsapps-deploy depends on a file to pass in configuration. By default, it looks for config.json — but you are welcome to point it elsewhere via --config.

Usage: newsapps-deploy [COMMAND] [--config=PATH] [--dry-run] [--gzip] [--
production]

Commands:
  deploy  Deploy the project to S3
  push    Push assets to S3
  pull    Pull assets from S3

Options:
  -c, --config      The path to the config file         [default: "config.json"]
  -g, --gzip        Pushes code to your specified bucket with predefined HTTP
                    cache headers                                      [boolean]
  -p, --production  Push code to the production bucket (defaults to development)
                                                                       [boolean]
  -d, --dry-run     Print the commands instead of running them (good for
                    checking things out)                               [boolean]
  -h, --help        Show help                                          [boolean]

config.json should contain an object with a deployment key with the following fields:

{
  "deployment": {
    "dev_s3_bucket": "notarealbucket.texastribune.org",
    "prod_s3_bucket": "graphics.texastribune.org",
    "path": "graphics",
    "slug": "corgis-vs-red-pandas",
    "aws_profile": "newsapps",
    "dist_folder": "dist",
    "assets_folder": "app/assets"
  }
}

Field definitions

dev_s3_bucket

Push test deploys to this bucket

prod_s3_bucket

Push production deploys to this bucket

path

The path to the folder where code should be pushed.

slug

The slug of the folder (located in path) where code should be pushed.

aws_profile

The AWS credential to use for deployment. If empty, nothing will be passed to awscli via --profile.

dist_folder

The folder that should be pushed up to S3. This should be your content ready for deploy.

assets_folder

The folder where raw assets are located — typically app/assets.

Default cache headers

The assumpion is that the .css and .js are being revisioned. If --gzip is passed, the following files will be assumed to be gzipped:

.html
.css
.js
.json

.css and .js are set to expire in 1 year. Images — .jpg, .png, .svg, and .gif — are set to expire in 1 day. .json files will expire in 1 hour. .html have no set expiration.

Wait – this depends on a Python library?

There is a library for AWS written in node.js called aws-sdk. However, multiple parts of our workflow already generous depend on awscli — to the point it can be assumed that it's already installed and configured.

Also — aws-sdk has no command line interface built in. Any tasks we need to accomplish would have to be written ourselves. Why reinvent the wheel? ¯_(ツ)_/¯