tadasajon
tadasajon

Reputation: 14856

Meteor.js - can I drop into a Meteor shell to try out some JavaScript in my Meteor environment?

I often develop in Python and sometimes find it useful to type python at the terminal prompt and drop into a Python shell where I can import various modules and test some behavior. Node.js has similar functionality if I type node at the command line.

I'd like to do the same now that I'm developing with Meteor. How can I get to a shell prompt where all the packages I have added with meteor add are loaded and ready for me to play with?

Upvotes: 3

Views: 239

Answers (3)

Dean Radcliffe
Dean Radcliffe

Reputation: 2206

As of recently, meteor shell will give you a REPL into the server process. Of course, you know this @JoshOwens, I think I heard about this on your podcast :)

Upvotes: 1

Josh Owens
Josh Owens

Reputation: 191

Just install node-inspector and then you can easily use the node-debug command to run node-debug mrt. That should open a debugger console.

You can then just drop a debugger; keyword onto a line anywhere in your code to drop into a REPL like setting.

Upvotes: 2

Marco de Jongh
Marco de Jongh

Reputation: 5448

Node.js and python are both interpreters.

Meteor is a application framework build upon node.js. So testing out code in the way you mentioned is impossible.

You can however use the chrome debugging tools to run client side code within your meteor application.

Executing server side code to see what it does is a bit harder but also not impossible. Best way would probaply to setup nodejs remote debugging and using the debugger. See: Meteor debugging setup

Upvotes: 0

Related Questions