Edit and save json file with a script (not to local storage, but to the json file)

Here is the code, I want to prompt the user with a window alert asking to enter a username, if one already exists in the json with a password alert it already exists, otherwise open new alert for entering password, once both have been enteres save the account name and password to the json in the editor. Is this possible without a server?