It would be very helpful for me to test my parse.com javascript code in an interpreter environment. So I can query an object and see the response immediately.
Node.js comes with an interpreter, but I need to figure out how to import the parse object. This seems to be done through the parse.js file (http://www.parsecdn.com/js/parse-1.2.19.min.js). In the parse tutorials it is included in <script> tags in the html like so
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.2.19.min.js"></script>
But for this I need to figure out how to do the import using javascript. Does anyone know how to import an external file? I tried require("http://www.parsecdn.com/js/parse-1.2.19.min.js") but got an error.
Update:
I was able to import the Parse code by downloading the parse file and using require locally with
var Parse = require("./parse-1.2.19.min.js");
Localstorage and xmlhttprequest have to be installed beforehand for this to work. However when I do Parse.initialize(-removed keys-) I get
TypeError: Object function (e){return e instanceof w?e:this instanceof w?(this._wrapped=e,void 0):new w(e)} has no method 'initialize'
var Parse = require("./parse-1.2.19.min.js").Parse;and installing localstorage and xmlhttprequest also worked! Directly installing parse using npm as suggested in Paul's answer is more elegant, however.