I currently have a json file setup in the following format:
{ "OnetimeCode" : "Value" }
And I would like to be able to do two things:
- Add to file (change values ββin file)
- Add new items to the file (in the same format)
I searched for almost an hour, trying to find either a module (for Node) or just a simple code example that would allow me to execute this.
I already tried to use several plugins, but instead of adding to the file, they completely rewrite it.
One of the plugins is called "jsonfile" (npm install jsonfile)
var jf = require('jsonfile');
But this does not seem to work.
Any help is appreciated! But please keep it simple.
Also: I can not use jQuery
source share