compare-with-file

1.1.0 • Public • Published

compare-with-file

Build Status v1.1.0

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

Readme

Keywords

none

Package Sidebar

Install

npm i compare-with-file

Weekly Downloads

1

Version

1.1.0

License

ISC

Last publish

Collaborators

  • reergymerej