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 🙏

© 2021 – Pkg Stats / Ryan Hefner

haiku9

v4.0.9

Published

Asset compilation, static-site generator

Downloads

298

Readme

Haiku9

Haiku9 (H9 for short) is a static site publisher. H9 supports:

  • Syncing Web assets with an S3 bucket
  • Configuring that bucket as a website
  • Optionally fronting that bucket with a CloudFront distribution to support edge caching and/or TLS termination.

H9 provides CLI and programmatic interfaces, though most of the configuration is handled with your h9.yaml file.

Installation

Local

npm install -g haiku9

Configuration

AWS Profile

H9 uses your AWS access to perform actions on your behalf. Your environment needs access to AWS credentials that can be reached by the SharedIniFileCredentials method

From that reference:

defaulting to ~/.aws/credentials or defined by the AWS_SHARED_CREDENTIALS_FILE environment variable

Within that file, you can assign credentials to multiple "profiles" for easy access. H9 can accept that profile name as a command-line argument

h9 publish production -p "panda"

H9 File

At the root of your site, create a h9.yaml file. Here is an example for publishing to a hypothetical https://haiku9.pandastrike.com

# The directory Haiku9 will copy into an S3 bucket.  The local directory is
# authoritative, so files will be added or deleted from your bucket to make
# it match. Haiku9 also uses MD5 hashes to make sure existing bucket files
# are current.
source: build

# The root domain for your site.
domain: pandastrike.com

# The AWS region you would like to use for your S3 bucket that serves your site
region: us-west-1

# The default path when navigating to "/", as well as the page to serve if
# a requested path does not exist.
site:
  index: index
  error: 404

# If you a publishing content to CDN that will be accessed through CORS, you can set your CORS settings here.  `wildstyle` is the permissive "*"
cors: wildstyle


# Haiku9 uses environments to organize your a project's configuration into
# sections while maintaining access to common configuration.  Each environment
# is named as the keys in the dictionary below.
environments:

  # The staging environment has a hostname, but no cache configuration, so it
  # will serve directly from the S3 bucket without TLS termination.
  staging:
    hostnames:
      - staging-haiku

  # The production environment has a different hostname setting, as well as
  # configuration for the CloudFront distribution.
  production:
    hostnames:
      - haiku
    cache:
      expires: 1800 # 30 minutes
      ssl: true
      priceClass: 100

Publishing

To publish your compiled site to AWS, first confirm that your AWS credentials are defined in ~/.aws/credentials:

[default] aws_access_key_id=AKIAIOSFODNN7EXAMPLE aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Next, publish to AWS:

h9 publish <environment>

And in a few minutes you will have a new website.

If you would like to tear it down.

h9 delete <environment>

And it will be gone just as easily.