I am using rn-nodeify for enabling the use of pdf2json in React Native. pdf2json uses fs
for loading files using the method readFileSync
. I am getting this error when I try to use the library:
fs.readFileSync is not a function. (In 'fs.readFileSync(_basePath + fieldName, 'utf8')', 'fs.readFileSync' is undefined)
I cannot find any support for this issue. Any pointers appreciated.
Edit: Please note that I am not trying to run this in a browser. This pertains to react-native i.e. it runs on a device, and the code should have access to the file system.