Not sure if this question fits here, but it's really bothering me. Currently using Node v10.16.0. Apologies!
With Angular 7, fs
no longer functions - what is the optimal method to write to a JSON file?
Importing a JSON file is now simple, but how can I write to it?
In regards to what I attempted:
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' `