Looking to save an array of objects from your javascript code into an external JSON file? Specifically, you want to store it in Webstorm's package.json. Most resources focus on retrieving data from an external JSON file, but how can you accomplish the opposite?
Take a look at this example javascript array:
var questions = [{
question: "Question1",
choices: ["Choice1", "Choice2", "Choice3", "Choice4"],
corAnswer: 0
}, {
question: "Questions2",
choices: ["Choice1", "Choice2", "Choice3", "Choice4"],
corAnswer: 1
}, {
question: "Question3",
choices: ["Choice1", "Choice2", "Choice3", "Choice4"],
corAnswer: 3
}];
You may be thinking of using JSON.stringify, but then how do you go about storing it in package.json?