Interface Options

Comparison options.

Hierarchy

  • Options

Indexable

[key: string]: any

Properties

compareSize?: boolean

Compares files by size. Defaults to 'false'.

Usually one of compareSize or compareContent options has to be activated. Otherwise files are compared by name disregarding size or content.

compareContent?: boolean

Compares files by content. Defaults to 'false'.

Usually one of compareSize or compareContent options has to be activated. Otherwise files are compared by name disregarding size or content.

compareDate?: boolean

Compares files by date of modification (stat.mtime). Defaults to 'false'.

Also see dateTolerance.

dateTolerance?: number

Two files are considered to have the same date if the difference between their modification dates fits within date tolerance. Defaults to 1000 ms.

compareSymlink?: boolean

Compares entries by symlink. Defaults to 'false'.

If this option is enabled two entries must have the same type in order to be considered equal. They have to be either two fies, two directories or two symlinks.

If left entry is a file and right entry is a symlink, they are considered distinct disregarding the content of the file.

Further if both entries are symlinks they need to have the same link value. For example if one symlink points to '/x/b.txt' and the other to '/x/../x/b.txt' the symlinks are considered distinct even if they point to the same file.

skipSubdirs?: boolean

Skips sub directories. Defaults to 'false'.

skipEmptyDirs?: boolean

Ignore empty directories. Defaults to 'false'.

skipSymlinks?: boolean

Ignore symbolic links. Defaults to 'false'.

ignoreCase?: boolean

Ignores case when comparing names. Defaults to 'false'.

noDiffSet?: boolean

Toggles presence of diffSet in output. If true, only statistics are provided. Use this when comparing large number of files to avoid out of memory situations. Defaults to 'false'.

includeFilter?: string

File name filter. Comma separated minimatch patterns. See Glob patterns.

excludeFilter?: string

File/directory name exclude filter. Comma separated minimatch patterns. See Glob patterns.

handlePermissionDenied?: boolean

Handle permission denied errors. Defaults to 'false'.

By default when some entry cannot be read due to EACCES error the comparison will stop immediately with an exception.

If handlePermissionDenied is set to true the comparison will continue when unreadable entries are encountered.

Offending entries will be reported within permissionDeniedState, reason and permissionDenied.

Lets consider we want to compare two identical folders A and B with B/dir2 being unreadable for the current user.

A                    B
├── dir1 ├── dir1
├──── file1 ├──── file1
├── dir2 ├── dir2 (permission denied)
└─────file2 └─────file2

diffSet will look like:

relativePath path1 path2 state reason permissionDeniedState
[/] dir1 dir1 equal
[/dir1] file1 file1 equal
[/] dir2 dir2 distinct permission-denied access-error-right
[/dir2] file2 missing left

And permissionDenied statistics look like

{
leftPermissionDenied: 0,
rightPermissionDenied: 1,
distinctPermissionDenied: 0,
totalPermissionDenied: 1
}
resultBuilder?: ResultBuilder

Extension point used for constructing the Result object.

See Result builder.

compareFileSync?: CompareFileSync

Extension point used to perform sync file content comparison.

See File comparators.

compareFileAsync?: CompareFileAsync

Extension point used to perform async file content comparison.

See File comparators.

compareNameHandler?: CompareNameHandler

Extension point used to compare files or directories names.

See Name comparators.

filterHandler?: FilterHandler

Extension point used to control which files or directories should be included in the comparison.

See Glob filter.

Generated using TypeDoc