-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
hub.js
Hector edited this page Aug 24, 2021
·
6 revisions
The hub feature is an optional feature that allows you to watch a directory and upload all of its content on the database (only text files are supported for now).
First, you must install Chokidar. When it’s done, import hub.js :
const hub = require('gun/lib/hub'); // Classic
// or
import hub from ‘gun/lib/hub’; // ES6’s way
// then
hub.watch(/* The path you want to watch. */)what (String) - Which directory hub should watch.
options (Object) - Change the behavior of hub.
// Available options
{
msg: true // or false | disable or enable update messages
}