title: How to import .json file as arguments to .js file and launch it using command line?
body: <p>I have a .json file stored in a local directory on my computer.</p>
  
  data.json
  
  <pre><code>{ 
    "foo": "bar",
    "baz": "bat"
  }
  </code></pre>
  
  <p>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.</p>
  
  app.js
  
  <pre><code>var foo = "bar",
      baz = "bat"; // Somehow, I need to import these arguments from data.json
  // Then do stuff with them...
  </code></pre>
  
  <p>app.js is a pure javascript file (without access to an HTML "wrapper" or any JS libraries like jQuery, etc.).</p>
  
  <p>I would like to use one of the following to call app.js:</p>
  
  <ol>
  <li>Command line / shell script (including but not necessarily node.js),</li>
  <li>AppleScript (Mac OS X Yosemite v.10.10.1), or</li>
  <li><a href="http://wiki.imacros.net/Bookmarklet" rel="nofollow">iMacros for Firebox bookmarklet</a>.</li>
  </ol>
  
  <p>How can I accomplish this?</p>