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

swiff-5

v1.0.9

Published

Swiff saves you time with common SSH tasks during the development of websites/apps

Downloads

17

Readme

Swiff

Note: Currently in Development (Will merge to Swiff after approval)

Swiff streamlines common SSH tasks during website/app development, saving you valuable time.

Key Features

🚀 Folder Synchronization

Keep folders in sync between servers effortlessly.

💫 Database Management

Manage databases between servers with automatic backups.

🎩 Composer File Management

Transfer composer files between servers with automatic backups.

💻 Remote Terminal Connection

Launch an SSH session directly into the remote site/app folder.

💻 Logger

Access all logs with swiff.log.

Getting Started

  1. Install Swiff globally with npm:

    npm install --global swiff-5@latest
  2. Run Swiff:

    swiff-5

Additional Features

  • Custom SSH Identity: Swiff uses your identity located at /Users/[currentUser]/.ssh/id_rsa. Specify a custom SSH key path in your .env file with:

    SWIFF_CUSTOM_KEY="/Users/[your-user]/.ssh/[key-filename]"
  • Gzipped Backups: Automatically back up and gzip your files and databases whenever they change.

  • Disable Specific Tasks: Specify tasks to disable via a config setting.

  • Dotenv Setup: Required .env

# The environment currently running in ('dev', 'staging', 'production', etc.)
ENVIRONMENT="dev"

SECURITY_KEY=""

DB_USER="db"
DB_PASSWORD="db"
DB_DATABASE="db"
DB_PORT="3306"
DB_DRIVER="mysql"
DB_SERVER="localhost"
DB_TABLE_PREFIX="craft"

Also this can be prefixed in swiff.config.js

  env: {
    prefix: "CRAFT_",
  },
  • Folder Sync Enhancements: New features include see diff and validation sync with git.

  • Enhanced Logger: swiff.log includes max size settings to manage log file size:

    logging: {
      enabled: true,
      dir: '', // Default root: "./storage/logs/"
      maxSize: 10 * 1024 * 1024, // Recommended 10MB max log file size
    },
  • Multi-Environment Support: Must have defaultEnvironment in environments object.

    defaultEnvironment: "staging",
    environments: {
      staging: {
       // The SSH login username
        user: "",   
        // The IP/hostname of the remote server
        host: "",  
        // The working directory of the remote app folder
        appPath: "",
        // The SSH port to connect on (22 is the SSH default)
        port: 22,
      },
      production: {
        user: "",   
        host: "",  
        appPath: "",    
        port: 22,
      },
    },

Requirements

Swiff requires Node.js LTS version (16.0.0+).

Place the following in swiff.config.js at the root of your application:

export default {
  defaultEnvironment: "staging",
  logging:{
    enabled: true,
    // change log directory (Default root: example "./storage/logs/")
    dir:'', 
    // recommended 10mb max log file size than clears log 
    maxSize: 10 * 1024 * 1024, 
  },
  environments: {
    staging: {
     // The SSH login username
     user: "",   
     // The IP/hostname of the remote server
     host: "",  
     // The working directory of the remote app folder
     appPath: "",
     // The SSH port to connect on (22 is the SSH default)
     port: 22,
    },
    production: {
      user: "",   
      host: "",  
      appPath: "",    
      port: 22,
    },
  },
  local: {
    // Play sound for task start, message, error
    playsound: true, 
    // If the env is ddev 
    ddev: true,
    // Add validation check with git for folderPush makes it consistent 
    git: true 
  },
  env:{
    prefix: null
  },
  pushFolders: [
    // { path: "config", exclude: "/project/*" },
    // 'templates',
    // 'web/dist'
  ],
  pullFolders: [
    // 'web/assets/volumes'
  ],
  disabled: ["databasePush"],
};
;

Swiff works with MySQL databases and supports ddev (requires local.ddev = true).

Technology

  • Node.js - JavaScript runtime built on Chrome's V8 engine
  • Ink 2 - React for interactive command-line apps
  • Babel - JavaScript transpiler
  • Rollup - JavaScript module bundler
  • Prettier - Code formatter
  • Pino - Logger

Credits