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

broilerpan

v0.5.1

Published

Command line utility for Broilerplate, enabling easy deployment and set up of scalable web apps to AWS cloud.

Downloads

1

Readme

BroilerPan

BroilerPan is a command line interface for bootstrapping and deploying scalable, production-ready web apps! It works with projects using BroilerKit development kit library!

The command line interface includes commands to deploy your web app to Amazon Web Services cloud platform, with minimal setup and very low costs! The hosting is almost free on low-traffic sites.

(Disclaimer: By using this utility you are taking the responsibility for any incurring expenses.)

Development features

  • Quickly bootstrap your project with Broilerplate templates
  • Write your code in TypeScript! It will be compiled to ES5 JavaScript
  • Write your stylesheets in SASS! It will be compiled to CSS
  • Lint your code style with TSLint and ESLint
  • Generate static HTML pages from Pug templates
  • Automatically bundle and optimize any images from your HTML, Pug, or Markdown files.
  • Include Markdown to your Pug templates. You may include with filters but != require("foo.md") is preferred because it will also require any images.
  • Generate favicons and related asset files from a single icon image file, and insert references to the HTML pages
  • Refer to your current GIT version with __COMMIT_HASH__, __VERSION__ and __BRANCH__ constants

Deployment features

  • Deploy your compressed, production-ready web app to AWS platform, hosted on S3, served globally through CloudFront, and managed with CloudFormation
  • Make your app available on your custom domain (required)
  • Your app is served using HTTPS! Creation of required certificates are done automatically with Amazon Certificate Manager
  • Host static assets on separate cookieless domain with infinite caching, for maximum performance scoring and reliability
  • Separate stages for your releases, e.g. the production version (prod) and the development version (dev)

What do I need?

To use this utility, you need the following:

Installing

Install the command line utility:

npm i -g broilerpan

After this you can use the broil command. To get the overview of the available commands, run broil help:

$ broil help
Commands:
  init [directory]      Bootstrap your project with Broilerplate template.           [aliases: pull]
  deploy <stage>        Deploy the web app for the given stage.
  undeploy <stage>      Deletes the previously deployed web app.
  logs <stage> [since]  Print app logs.
  compile <stage>       Compile the web app.                                        [aliases: build]
  preview <stage>       Preview the changes that would be deployed.
  describe <stage>      Describes the deployed resources.
  serve [stage]         Run the local development server.

Options:
  --appConfigPath  Path to the app configuration                        [string] [default: "app.ts"]
  --debug          Compile assets for debugging                                            [boolean]
  --no-color       Print output without colors                                             [boolean]
  --help           Show help                                                               [boolean]
  --version        Show version number                                                     [boolean]

Creating a web app

You can easily bootstrap a new web app:

broil init myapp

This will create a folder myapp and initialize it as a GIT repository, if not already initialized. Then it will apply the Broilerplate template to your project. It will then also install node dependencies for you!

If you have already created a GIT repository for you app, just run this in the directory:

broil init

After bootstrapping your project, you should add the metadata to the package.json file, for example, name, author, description.

NOTE: If installing node dependencies fails on OSX you may try to install libpng with Homebrew.

Configuring the app

You should change the configuration in app.ts according to your web app's needs.

  • name: A distinct name of your app. Recommended to be in lower case and separate words with dashes, because the name will be used in Amazon resource names and internal host names.
  • stages: Configuration for each different stage that your app has. By default there are dev stage for a development version and prod stage for the production version. You should change the siteDomain and assetsDomain to the domain names that you would like to use for each stage. There is also a special stage local that is used for the locally run development server.

Running locally

To run the app locally, start the local HTTP server and the build watch process:

broil serve

Then navigate your browser to the website address as defined in your local stage configuration, which is http://localhost:1111/ by default!

The web page is automatically reloaded when the app is re-built.

Deployment

Prerequisities

Set up AWS credentials

First, create a user and an access key from AWS Identity and Access Management Console.

Then you need to set up your AWS credentials to your development machine. This can be done with aws-cli command line tool, which you may need to install first:

# Install if not already installed
pip install awscli
# Optional: enable command line completion
complete -C aws_completer aws
# Configure your credentials
aws configure

Create a Hosted Zone

NOTE: You need to create a Hosted Zone for Amazon Route53 for your custom domain first! Also, if you are using other domain name provider, such as GoDaddy, then you need to set up the DNS records for your domain.

Running deployment

Deployments are run with the following command:

broil deploy <stage>

For example, to deploy the development version to the dev stage:

broil deploy dev

To deploy the production version to the prod stage:

broil deploy prod

IMPORTANT: When deploying for the first time, you will receive email for confirming the certificate for the domain names! The deployment continues only after you approve the certificate!

The deployment will build your app files, and then upload them to Amazon S3 buckets.

The assets (JavaScript, CSS, images) are uploaded first. Their names will contain hashes, so they won't conflict with existing files. They will be cached infinitely with HTTP headers. The HTML files are uploaded last and they are cached for a short time.