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

scottyjs

v1.10.2

Published

A simple CLI tool that deploys your project to AWS S3

Downloads

1,294

Readme

Scotty.js

Deploy static websites or folders to AWS S3 with a single command

Build Status npm npm npm Join the chat at https://gitter.im/scottyjs/scotty

Install

Scotty.js is available on NPM. Install it as a global dependency to be able to use scotty command anywhere:

npm install scottyjs --global

Use

Beam me up, Scotty

To deploy a static folder to AWS S3 run:

scotty {options}

or

beam-me-up {options}

Available options

  • --help or -h - Print this help
  • --version or -v - Print the current version
  • --noclipboard or -n - Do not copy the URL to clipboard (default: false)
  • --quiet or -q - Suppress output when executing commands (default: false)
  • --website or -w - Set uploaded folder as a static website (default: false)
  • --spa - Set uploaded folder as a single page app (default: false)
  • --source or -s - Source of the folder that will be uploaded (default: current folder)
  • --bucket or -b - Name of the S3 bucket (default: name of the current folder)
  • --prefix or -p - Prefix on the S3 bucket (default: the root of the bucket)
  • --region or -r - AWS region where the files will be uploaded, default: saved region if exists or a list to choose one if it is not saved yet
  • --force or -f - Update the bucket without asking (default: false, forced region can be overridden with -r)
  • --update or -u - Update existing bucket (default: false)
  • --delete or -d - Delete existing bucket (default: false)
  • --nocdn or -c - Disable Cloudfront handling (default: false)
  • --urlonly or -o - Only output the resulting URL, CDN or S3 according to options (default: false)
  • --expire or -e - delete objects on bucket older than n days (default: no expiration)
  • _--profile or -a - AWS profile to be used (default: 'default')
  • _--empty or -y - Empty the bucket (Delete all objects before upload files) (default: false)

Examples

Create React App application

Full tutorial: http://medium.com/@slobodan/single-command-deployment-for-single-page-apps-29941d62ef97

To deploy CRA apps simply run npm run build in your project root folder to create build version.

Then deploy build version using following command:

scotty --spa --source ./build

Or, if you want to specify bucket name run:

scotty --spa --source ./build --bucket some-bucket-name

With --spa flag, Scotty will set required redirects for your single page app, so your app can use pushState out of the box.

Shared bucket application

To deploy multiple apps to a single bucket you can make use of the --prefix option. This comes in handy when your CI system deploys to a staging system with each branch as a pathname. Eg. the master branch should go to bucket root (/), so you do not set the prefix. The feature/fancy-stuff branch should go to the bucket path feature/fancy-stuff so just add this as the prefix. Here comes a command line example:

# deploy your master branch build to bucket root
scotty --source ./build --bucket some-bucket-name
# deploy your branch build to the branch name on the bucket
scotty --source_ ./build --bucket some-bucket-name --prefix your/branch

Test

We use Jasmine for unit and integration tests. Unless there is a very compelling reason to use something different, please continue using Jasmine for tests. The existing tests are in the spec folder. Here are some useful command shortcuts:

Run all the tests:

npm test

Run only some tests:

npm test -- filter=prefix

Get detailed hierarchical test name reporting:

npm test -- full

License

MIT -- see LICENSE