fx54-node
Verify the existence or content of files with a hierarchical object.
Installation
yarn add fx54-node
Run tests
yarn test
Example
Assume a directory like this:
- root
- dir1
a.txt
- dir2
b.txt
Example code:
; try await validator; console; catch err console;
API
-
async validateFileAsync(path: string, value: any)
: validates a file with a possible value.string
value: tests equality of the contents of file.boolean
value: verifies existence of the file.
-
async validateDirectoryAsync(path: string, obj: any)
: validates a directory with a hierarchical object. For example:
dirA: subDirA: file1: true subDirB: file2: "<contents>" file3: false