1.4.0 • Published 5 months ago

minio-sync v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

MinIO folders sync

NPM package for folders synchronization via MinIO

Install

npm install minio-sync

Usage

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: "<YOUR_MINIO_ACCESSKEY>",
            SecretKey: "<YOUR_MINIO_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

Path filtering

  • ignoreInitial - always will be false due to current implementation
  • ignored (anymatch-compatible definition) 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 ready event).
1.4.0

5 months ago

1.2.0

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.3.1

5 months ago

1.3.0

5 months ago

1.0.0

5 months ago