I'm not sure if this question belongs here, but this is driving me insane. I am running Node v10.16.0. Sorry!
Since in Angular 7 fs no longer works - what is the best way to write to a JSON file?
Importing a JSON file now works nice and easy, but how do I write to it?
Edit: Adding what I tried.
component.ts:
import * as fs from 'fs';
[...]
saveChanges(changes) {
fs.writeFile('config.json', JSON.stringify(config), null);
Error: `Module not found: Error: Can't resolve 'fs' `
fsmodule (or was it angular? anyway, it worked.) you could usefs.writeFile()for example.