read-resolved-file-sync
Deceive your linter by hiding both sync function calls.
API
resolveAndRead(remoteRequire, spec[, encoding])
The module exports this function.
remoteRequire
should be your module's require
, or true
if for some
reason you want to resolve relative to this module instead of yours.
spec
is whatever name you want resolved.
encoding
will be passed to fs.readFileSync()
, unless it is omitted
or undefined
, in which case 'UTF-8'
will be passed.
resolveAndRead(remoteRequire)
Return a function with arguments (spec[, encoding])
that acts as above
but remembers remoteRequire
.
Usage
from test/test.js:
var resolveAndRead = require origIndent = parsedMeta = fragments = resolveAndRead eq = deepStrictEqual; ;;;
License
ISC