0.9.2 • Published 2 years ago

@weichienhung/watchme v0.9.2

Weekly downloads
51
License
ISC
Repository
github
Last release
2 years ago

Watch file changes and upload to remote servers

Q: Why should i need this? A: Company ssh policy is a little big complex and i found many sftp plugin didn't work well. But the mac laptop rsync,sftp works ok. So i create a simple project to monitor changes and do upload to remote servers

Dependencies

  1. Install facebook's watchman on your laptop
  2. Install nodejs (version > 12.18.0)

How to use?

  1. install the package globally
> npm install @weichienhung/watchme -g
  1. init a config file

e.g: /User/samuelhung/myproject/ is the folder you want to monitor and auto upload change files. Run below command to get a config .watchme.json

> watchme -i

An example of .watchme.json

{
  "host": "remote server hostname",
  "user": "samuelhung",
  "type": "rsync",
  "remote_path": "/home/samuelhung/myproject",
  "debug": true,
  "ignore_regexes": [
    "watchme\\.json",
    "/venv/",
    "\\.svn/",
    "\\.hg/",
    "\\.git/",
    "\\.bzr",
    "_darcs",
    "CVS",
    "\\.DS_Store",
    "Thumbs\\.db",
    "desktop\\.ini",
    "node_modules/",
    "\\.vscode"
  ]
}

You can set a global config file in home dir. e.g: ~/.watchme.json Put common settings. like ignore_regexes

{
  "ignore_regexes": [
    "watchme\\.json",
    "/venv/",
    "\\.svn/",
    "\\.hg/",
    "\\.git/",
    "\\.bzr",
    "_darcs",
    "CVS",
    "\\.DS_Store",
    "Thumbs\\.db",
    "desktop\\.ini",
    "node_modules/",
    "\\.vscode"
  ]
}

The final config are merged from global and local.

  1. execute watchme

It will start monitor the folder and do upload when file changes.

> cd /User/samuelhung/myproject/
> watchme

Print watchme usage.

> watchme -h

Support watch multiple folders

Use -p profile1,profile2 to specify multiple configs

> watchme -p profile1,profile2
0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.6.2

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago