0.1.0 • Published 7 years ago
compare-directories v0.1.0
compare-directories
A simple function for to assert two directories.
Function access everything using asynchronous APIs to make sure it's efficient.
I just needed it for some project, and it made sense to extract it into a separate package. But it wasn't tested in any other project than mine, due to time constraints. This is why lib might not necessairly suit other use cases. If you fill you're up for the task, feel free to drop pull request. Any PRs are welcome.
Installation
$ npm install --save-dev compare-directories
Usage
const compareDirectories = require( 'compare-directories' );
it( 'passes with identical dirs', () => {
const input = path.join( __dirname, '_fixtures', 'same', 'input' ),
output = path.join( __dirname, '_fixtures', 'same', 'output' );
// Note that compareDirectories return Promise.
return compareDirectories( output, input, {
diff: true,
skipEol: true
} );
} );
Options
compareDirectories
function takes few options:
skipEol
- Boolean - Whether different End-of-Line markers should be ignored. Defaults totrue
.diff
- Boolean - Whether diff should be displayed if assertion fails. Defaults tofalse
.
License
MIT © Marek Lewandowski
0.1.0
7 years ago