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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fci/spajs

v0.0.5

Published

Tool for deploying static websites/spa to AWS.

Readme

SPAJS

SPAJS is a simple tool intended for quick and easy setup of static websites and single page application hosting on your AWS account.

Features

The tool automates following:

  • S3 bucket creation and static website hosting setup
  • CloudFront distribution creation with CNAME and SSL configuration
  • File versioning and optimization/minification before uploading to S3
  • File caching configuration

Install

$ npm install @fci/spajs -g

npm is a builtin CLI when you install Node.js - Installing Node.js with package manager

Initialization

To initialize website environment use the init command:

$ spajs init --help

  Usage: init [options] <env>

  initialize site environment

  Options:

    -h, --help                  output usage information
    -d, --site-domain <domain>  site domain
    -p, --profile [profile]     aws profile to use from ~/.aws/credentials file
    -r, --region [region]       aws region to use for site bucket
    -s, --ssl                   setup ssl

This command automates most of the steps described in Setting Up a Static Website Using a Custom Domain. For using SSL and CNAME with CloudFront you can find more information here.

Env parameter is the name of environment. For example if you are using GitFlow you can have dev environment for latest code version, staging for next release QA and production for current stable release. When you initialize environment configuration will be save under current directory in .spajs/<env>.json

Example

Following command creates S3 bucket test.foundcenter.com in eu-central-1 region, sets up CloudFront distribution for it with custom SSL certificate from AWS Certificate Manager and binds distrubution to CNAME test.foundcenter.com. When using CNAME option make sure that same CNAME is not used for any other distribution. To be able to setup SSL you will need to create domain certificate using AWS Certificate Manager.

$ spajs init dev -d test16.foundcenter.com -r eu-central-1 -s

Output:

Creating bucket test16.foundcenter.com in region eu-central-1...
Bucket test16.foundcenter.com created and configured for static website hosting.
Creating CloudFront distribution...
Setting CloudFront distribution domain test16.foundcenter.com...
Setting SSL certificate for domain test16.foundcenter.com...
CloudFront distribution E8LEBN3xxxx created.
Update your DNS settings! You need to set CNAME for domain test16.foundcenter.com to d205dq8zsd4fv.cloudfront.net

In order to use you custom domain setup DNS CNAME record to point to newely created CloudFront distribution. In our example test16.foundcenter.com needs to point to d205dq8zsd4fv.cloudfront.net.

Deployment

To deploy website content use deploy command:

$ spajs deploy --help

  Usage: deploy [options] <env> [path]

  deploy content to environment

  Options:

    -h, --help  output usage information

Example

$ spajs deploy dev

Output:

[14:10:20] [create] index.html
[14:10:20] [create] page2.html
[14:10:21] [create] css/style1.css
[14:10:23] [create] images/image1.png
[14:10:23] [create] js/app.js
[14:10:23] [create] js/app1.js
[14:10:24] [create] js/dyn.js
[14:10:24] [create] templates/template1.html
[14:10:25] [create] tmp/index.html
[14:10:25] [create] xxx/template1.xxx
[14:10:25] [create] css/style1.70cd6184.css
[14:10:27] [create] images/image1.991d6e1d.png
[14:10:27] [create] js/app.46d6ffa2.js
[14:10:27] [create] js/app1.39a89d88.js
[14:10:28] [create] js/dyn.d050a82d.js
[14:10:28] [create] xxx/template1.9cfdf0d7.xxx
[14:10:29] [update] index.html
[14:10:29] [update] page2.html
[14:10:29] [skip]   templates/template1.html
[14:10:29] [update] tmp/index.html

You can also deploy project (dir containing .spajs/) subfolder (e.g. dist/):

$ spajs deploy dev dist/

Deploy command first uses uglify and csso to optimize all css and js files than it uses rev-all to version each file and awspublish to push the to AWS S3 bucket.

In order to do caching correctly all files (except .html files) are versioned and aggressively cached Cache-Control: max-age=315360000, no-transform, public. All .html files are not cached Cache-Control: no-cache, no-store, must-revalidate.