compare-with-file
v1.1.0
Published
compare a string with the contents of a file
Downloads
4
Readme
compare-with-file
Compare the contents of a file with a string.
import { fileMatches } from 'compare-with-file';
fileMatches(filePath, 'expected contents'); // returns Boolean
To view a diff when the files don't match, use setLogging
.
import { fileMatches, setLogging } from 'compare-with-file';
setLogging(true);
example output
- expected
+ actual
- Th is is the input file.\n
"+-|+++-|---------------------"
+ w hoop s