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

@yishen_/fast-deploy

v0.0.3

Published

A CLI tool and library for fast deployment to remote servers using SFTP

Downloads

34

Readme

fast-deploy

A simple and fast deployment tool for Node.js, based on ssh2-sftp-client.

Features

  • Upload a local directory to a remote server via SFTP.
  • Optional backup of the remote directory before upload.
  • Written in TypeScript with type definitions included.
  • CLI Support: Initialize and deploy with simple commands.
  • Multi-environment Support: Easily switch between dev, test, and prod configurations.

Installation

For use as a library:

npm install @yishen_/fast-deploy

For use as a CLI tool:

Global installation:

npm install -g @yishen_/fast-deploy

Or run with npx:

npx @yishen_/fast-deploy

CLI Usage

1. Initialize

Run the init command in your project root to generate a configuration file and add a deployment script to package.json.

fast-deploy init

This will:

  • Create a .fastdeploy configuration file.
  • Add "publish": "fastdeploy" to scripts in your package.json.
  • Create a .gitignore (or update existing) with .fastdeploy*.

2. Configuration

Edit the .fastdeploy file (JSON format):

{
  "localPath": "dist",
  "remotePath": "/var/www/html/my-app",
  "server": {
    "host": "192.168.1.100",
    "username": "user",
    "privateKeyPath": "/path/to/private/key",
    "// OR": "password: 'your-password'",
    "port": 22
  },
  "backupPath": "/var/www/backups"
}

3. Deploy

Run the deploy command (or use the npm script):

fast-deploy
# OR
npm run publish

4. Environments

You can support multiple environments by creating specific configuration files:

  • .fastdeploy (Default)
  • .fastdeploy.dev (Development)
  • .fastdeploy.test (Testing)
  • .fastdeploy.prod (Production)
  • .fastdeploy.uat (UAT)

Run with specific environment:

fast-deploy --dev
# Reads .fastdeploy.dev. If not found, falls back to .fastdeploy

fast-deploy --test
# Reads .fastdeploy.test

fast-deploy --mode prod
# Reads .fastdeploy.prod

fast-deploy --config ./custom-config.json
# Uses specific config file

Library Usage

const { deploy } = require('@yishen_/fast-deploy');
// or
import { deploy } from '@yishen_/fast-deploy';

deploy({
  localPath: 'dist', // local directory to upload, default is 'dist'
  remotePath: '/var/www/html/my-app', // remote directory
  server: {
    host: '192.168.1.100',
    username: 'user',
    password: 'password', // or privateKey
    port: 22 // default is 22
  },
  backupPath: '/var/www/backups' // optional: backup remotePath to this directory before upload
})
.then(() => {
  console.log('Deployment success!');
})
.catch(err => {
  console.error('Deployment failed:', err);
});

Options

deploy(options)

options

  • localPath (string, optional): Path to the local directory to upload. Defaults to 'dist'.
  • remotePath (string, required): Path to the remote directory on the server.
  • server (object, required): SFTP connection settings.
    • host (string): Server hostname or IP.
    • username (string): SSH username.
    • password (string, optional): SSH password.
    • privateKey (string, optional): Private key content (Buffer or string).
    • privateKeyPath (string, optional): Absolute or relative path to private key file.
    • port (number, optional): SSH port. Default is 22.
  • backupPath (string, optional): If provided, the current content of remotePath will be moved to a subdirectory inside backupPath with a timestamp.