Does the Meteor framework come with a REPL or console of some kind? If not, any idea how to use the Node.js REPL in a way that bootstraps the Meteor environment?
I'm essentially looking for something like the rails console, or the javascript console in a web browser: a command line interface that makes the application's full context available, so I can arbitrarily inspect objects like Meteor
and Template
.
Starting the REPL is simple - just run node on the command line without a filename. It then drops you into a simple prompt ('>') where you can type any JavaScript command you wish. As in most shells, you can press the up and down arrow keys to scroll through your command history and modify previous commands.
Note: REPL stands for Read Evaluate Print Loop, and it is a programming language environment (basically a console window) that takes single expression as user input and returns the result back to the console after execution. The REPL session provides a convenient way to quickly test simple JavaScript code.
You can run it from the root directory of the project or from any subdirectory. Use 'meteor create ' to create a new Meteor project. Commands: run [default] Run this project in local development mode. ... run is the default in case no other command is specified after meteor .
Yes, since version 1.0.2, Meteor has a REPL.
Simply use meteor shell
to be dropped to the REPL, which is very similar to Node's.
$ meteor shell
Welcome to the server-side interactive shell!
Tab completion is enabled for global variables.
Type .reload to restart the server and the shell.
Type .exit to disconnect from the server and leave the shell.
Type .help for additional help.
> Meteor.isServer
true
>
You will have access to the full Meteor environment, and code will be run as if it were server-side code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With