I have a .json file stored in a local directory on my computer.
data.json{
"foo": "bar",
"baz": "bat"
}
I want to load data.json as arguments somehow into a .js file that I also have stored locally on my computer. Then run it.
app.jsvar foo = "bar",
baz = "bat"; // Somehow, I need to import these arguments from data.json
// Then do stuff with them...
app.js is a pure javascript file (without access to an HTML "wrapper" or any JS libraries like jQuery, etc.).
I would like to use one of the following to call app.js:
- Command line / shell script (including but not necessarily node.js),
- AppleScript (Mac OS X Yosemite v.10.10.1), or
- iMacros for Firebox bookmarklet.
How can I accomplish this?