npssh

1.0.1 • Public • Published

npssh

  • A node library that pushes files the remote server via the ssh.
  • The library is based on node-ssh.

Installation

npm install npssh -D

# global
npm install npssh -g

Run

And create .npssh.cjs | .npssh.json | .npssh.yml in your project root:

module.exports = {
  host: "localhost",
  username: "root",
  password: "123456", // or privateKeyPath: "/path/to/private/key"
  from: "./dist",
  to: "/root/dist",
  isDeleteRemoteFiles: true, // Whether to delete all the files in the remote folder. default value: false 
}
  • if you want protect your's private information, you need to add .npssh to .gitignore.

Add script for package.json:

For example:

"scripts": {
  "push": "npssh push"
}
npm run push
  • use other config file:

npssh.config.cjs

"scripts": {
  "push": "npssh push -c ./npssh.config.cjs"
}
npm run push
  • use cli
npm install npssh -g

# use npssh.cjs
npssh push

# use other config file
npssh push -c ./config.cjs

License

It is MIT.

Readme

Keywords

Package Sidebar

Install

npm i npssh

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

10.3 kB

Total Files

13

Last publish

Collaborators

  • windyeasy