Hi,
I am struggling to read a file with Assets.getText / getBinary and the ‘fs’ package.
I have tried this so far:
Assets.getText('/currencies.json', (err, res) => {
if(err) console.log(err);
console.log(res)
})
As well as the same code with getBinary. And also the usual:
const fs = require('fs');
const file = fs.readFileSync('path', 'utf8');
With ‘path’ being variations of the path to the file:
- /imports/utils/users/currencies.json
- ./currencies.json
- /currencies.json
I have tried putting the file in a random folder inside /imports, inside a /private folder and inside a /public folder but I’m not sure what I’m missing?