assert-fs-readfile-option
Test if a value is valid for fs.readFile options
const assertFsReadFileOption = ; ;// doesn't throw ;// throws `TypeError [ERR_INVALID_OPT_VALUE]: The value "foo" is invalid for option "flags"` ;// doesn't throw ;// throws `TypeError [ERR_INVALID_OPT_VALUE_ENCODING]: The value "base65" is invalid for option "encoding"` ;// doesn't throw
Installation
npm install assert-fs-readfile-option
API
const assertFsReadFileOption = ;
assertFsReadFileOption([maybeOption])
maybeOption: any types
It throws an error when the argument is not a valid value for fs.readFile options. See the test for more detailed specifications.
License
ISC License © 2017 Shinnosuke Watanabe