#not able to get JSON data outside the fs.readFile()
21 messages · Page 1 of 1 (latest)
how did you define fs?
oh wait nvm
misread
that fs is the callback async version, you can't extract data out of it
I just want to get an array out of it
been trying for hours
use the synchronous, or preferably the promise async version instead
I used callback
yet didn't work
yeah you're not supposed to
i am not much familiar with node.js
what do i have to change in that code ?
read through this to get an idea of promise async first
Will do
then you can use fs' promise api
I have to download util package ?
no
will try
@faint thunder gives me this