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

ssh-webpack-plugin

v0.1.8

Published

Webpack SSH deployment plugin.

Downloads

31

Readme

ssh-webpack-plugin

Webpack SSH deployment plugin.


The Webpack plugin is based on ssh2 and scp2.

The webpack plugin helps developers quickly and automatically deploy project projects to the production server, support for ssh-privateKey login, and shell execution before and after the deployment of the command.

Install

Install the plugin with npm:

npm install ssh-webpack-plugin --save-dev

Usage

Just add the plugin to your webpack config as follows:

var SshWebpackPlugin = require('ssh-webpack-plugin');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'build',
    filename: 'app.js'
  },
  plugins: [new SshWebpackPlugin({
        host: 'Remote host',
        port: 'Remote port',
        username: 'Remote username',
        password: 'Remote password',//or use privateKey login(privateKey: require('fs').readFileSync('/path/to/private/key')).
        from: 'Deploy Local path',
        to: 'Remote full path',//important: If the 'cover' of value is false,All files in this folder will be cleared before starting deployment.
  })]
};

Options

host

Type: String

The host of the remote server.

port

Type: String Default value: '22'

Port to connect to on the remote server.

username

Type: String

The username to connect as on the remote server.

password

Type: String

Password for the username on the remote server.

to

Type: String

Full path on the remote server where files will be deployed.

from

Type: String Default value: 'build'

Path on your local for the files you want to be deployed to the remote server. No trailing slash needed.

cover

Type: Boolean Default value: true [Important]: If this value is false,all files in remote path folder will be cleared before starting deployment.

Local Deployment files will be cover to deployment directory on remote path.

privateKey

Type: string

Path to your private key privateKey: require('fs').readFileSync('/path/to/private/key')

passphrase

Type: String

Passphrase of your private key if needed.

before

Type: String or Array

Commands to run on the server before and before deploy directory is created.

after

Type: String or Array

Commands to run on the server before and after deploy directory is created.

readyTimeout

Type: Number Default value: 20000

Default timeout (in milliseconds) to wait for the SSH handshake to complete.

zip

Type: Boolean Default value: true

Compress the build before uploading.

max_buffer

Type: Number Default value: 200 * 1024

Largest amount of data allowed on stdout or stderr.

exclude

Type: Array Default value: []

List of folders or files to exclude from build.

Usage Examples

Add setting in webpack.config.js:

plugins: [
    new SshWebpackPlugin({
        host: '10.211.55.5',
        port: '22',
        username: 'root',
        privateKey: require('fs').readFileSync('/Users/unadlib/.ssh/id_rsa'),
        before:'mkdir beforeTest',
        after:'mkdir afterTest',
        from: './build',
        to: '/root/test',
    })
]

Release History

  • 2016/10/22 - v0.1.7 - Add the 'cover' options.
  • 2016/10/22 - v0.1.4 - Initial Release.