Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/levidavidmurray/nfs-watcher-js
Node.js script to detect changes on a local filesystem, and force an inotify update on a remote machine
https://github.com/levidavidmurray/nfs-watcher-js
Last synced: about 2 months ago
JSON representation
Node.js script to detect changes on a local filesystem, and force an inotify update on a remote machine
- Host: GitHub
- URL: https://github.com/levidavidmurray/nfs-watcher-js
- Owner: levidavidmurray
- Created: 2019-05-06T03:06:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T08:23:35.000Z (about 2 years ago)
- Last Synced: 2023-03-05T21:21:57.653Z (almost 2 years ago)
- Language: JavaScript
- Size: 98.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NFS Watcher
Watches all files in a specified local directory, and forces a filesystem update on the remote machine whenever the file is changed locally. Useful for things like hot reloading with webpack when the source files are not local to where they're being used.### Usage
```shell
# Install dependencies
git clone https://github.com/levidavidmurray/nfs-watcher
cd nfs-watcher
yarn install
``````shell
# Configuration
vi watcher.config.js# See below
```**localWatchDirs**: Directories being watched for changes
**localAppRoot**: Local app root differentiating between local and remote filesystems
**remoteAppRoot**: Remote app root differentiating between remote and local filesystems
##### watcher.config.js
```config
module.exports = {
localWatchDirs: "/path/to/watch/directory/", // Array for multiple directories
localAppRoot: "/local/path/to/app/root",
remoteAppRoot: "/remote/path/to/app/root",devServer: {
host: 'domain.example.com',
port: 22,
username: 'user',
agent: '/path/to/ssh/agent'
// or specify private key
privateKey: '/home/levi/.ssh/id_rsa'
}
}
```
See [node-ssh](https://www.npmjs.com/package/node-ssh) for more SSH configuration options##### Example
```config
module.exports = {
localWatchDirs: ["/home/levi/myApp/src", "home/levi/myApp/lib"],
localAppRoot: "/home/levi/myApp",
remoteAppRoot: "/mnt/myApp",devServer: {
host: 'levi.myapp.ca',
port: 22,
username: 'myapp',
agent: '/run/user/1000/keyring/.ssh'
}
}
```