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

henrybuilt-cli

v1.2.1

Published

`hb <sub-command> [options]`

Downloads

1

Readme

Usage

hb <sub-command> [options]

Available subcommands

  • db-sync (Dumps production database and imports it into local database)
  • db-backup (Dumps production database and saves it to S3)
  • pt-backup-proposals (Backs up proposal pdfs for all PT Project Versions to S3)
  • audit-s3-file-permissions (Verifies client files are not publicly available)
  • hb db-sync -t staging (Dumps production database and imports it into staging database)

Usage

Initial setup

  1. cd ~
  2. git clone https://github.com/henrybuilt/henrybuilt-cli.git
  3. cd into henrybuilt-cli
  4. sudo npm install -g
  5. Place your env file at ~/hb.env (ask for a .env file if you don't have one)
  6. Run hb db-sync to test.
    • If there is an authentication error, run ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; in your mysql client

Updating

  1. cd into henrybuilt-cli
  2. git pull
  3. sudo npm install -g (if this doesn't work, sudo apt-get install npm)

Developing

  1. Pull
  2. Check out a branch
  3. Make modifications
  4. Verify script works as expected - e.g. node ./src/hb.js db-sync -t staging
  5. Bump version number

If you want to be able to run all commands, you need:

  • ~/hb.env file
  • mysql command/binary

The following are required to run each command:

  • pt-backup-proposals
    • env
      • HB_PRODUCTION_DB_HOST, HB_PRODUCTION_DB_USER, HB_PRODUCTION_DB_PASSWORD, HB_PRODUCTION_DB_DATABASE
      • HB_ADMIN_ACCESS_KEY
      • if you want to backup to s3 AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • db-sync
    • mysql command
    • mysqldump command
    • env
      • HB_PRODUCTION_DB_HOST, HB_PRODUCTION_DB_USER, HB_PRODUCTION_DB_PASSWORD, HB_PRODUCTION_DB_DATABASE
      • if your local mysql server has a non-empty password HB_DEVELOPMENT_DB_PASSWORD
    • if you want to sync faster, you can place aws-remote-backup.pem in home directory and include AWS_REMOTE_IP in env file
  • db-backup
    • mysql command
    • mysqldump command
    • env
      • HB_PRODUCTION_DB_HOST, HB_PRODUCTION_DB_USER, HB_PRODUCTION_DB_PASSWORD, HB_PRODUCTION_DB_DATABASE
      • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • wf-db-backup
    • ~/.pgpass file with correct permissions: chmod 0600 ~/.pgpass
    • pg_dump command - brew install postgresql@11
    • normal error output you can ignore that we didn't have time to fix:
      • SQL errors (~100 lines)
      • at checkExecSyncError (child_process.js:601:13)
    • use --skip when repeatedly syncing for faster syncs (skips download step)

The following commands have no prerequisites:

  • audit-s3-file-permissions

Usage

  • wf-backup-db
    • To restore from a compressed backup: pg_restore -Fc -h <host> -U <user> -d <db> < 2018-03-23_18-11-02.compressed
    • To restore from a SQL backup: pg_restore -h <host> -U <user> -d <db> < 2018-03-23_18-11-02.sql

TODO

  • macos notifications when complete
  • hb audit-website-permissions - arrays of links that are supposed to (in)accessible, pt api, admin, client site other users
  • hb de-backup-order-summaries
  • hb check-system-status
  • hb load-test ?
  • log time
  • backup to external service outside aws
  • audit document visibility, component icon visibility