NPM package for folders synchronization via MinIO
npm install minio-sync> NPM package for folders synchronization via MinIO
``bash`
npm install minio-sync
`ts
import minioSync from 'minio-sync';
minioSync(
"path/to/folder",
{
Permissions: {
/* Read from MinIO storage /
Read: true,
/* Write to MinIO storage /
Write: true,
},
MinIO: {
Bucket: "test-store",
EndPoint: "127.0.0.1",
Port: 9000,
UseSSL: false,
AccessKey: "
SecretKey: "
},
WatchOptions: {
ignored: [
// Ignore by string glob pattern
"ignore_folder/**",
// Ignore by regex pattern
/SomeIgnoreRegexPattern/,
// Ignore by callback function
function (path: string): boolean {
return path.split("/").length > 10; // Don't sync deep more than 10 levels
}
]
}
});
`
- Permissions: its highly recommended to use Write permissions only for one application node, cause there is no object blocking implementation on storage side now.
- WatchOptions: options from chokidar
- ignoreInitial - always will be false due to current implementationignored
- (anymatch-compatible definition)ready` event).
Defines files/paths to be ignored. The whole relative or absolute path is
tested, not just filename. If a function with two arguments is provided, it
gets called twice per path - once with a single argument (the path), second
time with two arguments (the path and the
instantiating the watching as chokidar discovers these file paths (before the