Skip to content

windyeasy/npssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A node library that pushes files the remote server via the ssh.

Resources

License

Stars

Watchers

Forks

Packages

No packages published