While testing, I’d like to read and write a file from and to disk (JSON in, JSON out). How do I do this in PureScript? In Haskell I have something like
main :: IO ()
main = do
input <- readFile "input.json"
writeFile "output.json" $ process input
All my attempts so far have failed, including trying to use readFile
from import Node.FS.Sync
.
BTW, if there is any other (better) way of reading in my JSON file, let me know. (I am not a JavaScript expert but I would like to port some — strict — Haskell code to JS so that it can be used elsewhere.)