Function compareDirectories() compares contents of two directories.
It is used to check if package generated by one of export functions and package downloaded from elsewhere, such as NPM package are identical. If packages are identical, there is no need to publish a new version.
Function has the following parameters:
- dir1, . Directory.
- dir2, . Another directory.
- options, . Optional options.
- true if contents of directories are identical.
- false if contents are different.
Function is asynchronous. That means you need to handle it as Promise instance, usually by adding await before function call.
Options object has the following optional properties:
- ignoreVersions, . If true, version numbers in package.json are ignored when comparing packages. Default is true.
- ignoreNewLine, . If true, differences in new line in text files are ignored when comparing text files. Default is true.
- textExtensions, . List of extensions to treat as text files. Default list includes all formats exported by various functions, but you can use this to add other extensions. Extensions should be in lower case.