Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

Same text: SyncFolderPushCommand


This interface synchronizes local folders to a DID Space.

Parameter Types#

Parameter

Kind

Required

Default

Parameter Descriptions

source

string or an array of SourceObject

Y

The source folder to be synchronized. Please add a trailing slash /.

target

string

Y

The source folder to synchronize to the destination folder. Please add a trailing slash "/" to folder paths.

Concurrency

number

N

256

Concurrency, defaulting to 256.

Retry count

number

N

3

Number of retries after a synchronization failure. The default is 3.

debug

boolean

N

false

Output debug information?

filter

function

N

Synchronizes all files by default, without filtering.

Filter function that excludes specific directories or files

tmpDir

string

N

The directory for temporary file storage. This is optional, but must be set at runtime.

Preview

Preview Template

N

Preview object being written

Returns#

Field Name

Kind

Required

Parameter Description

statusCode

number

Y

Status Code

Status message

string

N

This value is typically only present when an error occurs.

stack

string

N

Stack Trace

data.errorCount

number

Y

Number of failed tasks

data.count

number

Y

Total Tasks

data.duration

number

Y

Elapsed time (s)

Example Code#

  • Sync a local folder to DID Spaces
const { SpaceClient, SyncFolderPushCommand } = require('@blocklet/did-space-js');
const spaceClient = new SpaceClient({
endpoint,
wallet: getWallet(),
});

const syncFolderPushCommandInput = {
source: 'source-folder/',
target: 'target-folder/',
concurrency: 100,
retryCount: 5,
debug: true,
filter: (object, index, objects) => {...},
tmpDir: 'temp/'
};

const output = await spaceClient.send(new SyncFolderPushCommand(syncFolderPushCommandInput));


你获得 0 积分