Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Meteor have a REPL?

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.

like image 477
Zeke Avatar asked Dec 31 '12 02:12

Zeke


People also ask

How do I access REPL?

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.

What is REPL session?

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.

How do I run a meteor application?

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 .


1 Answers

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.

like image 84
Léo Lam Avatar answered Sep 22 '22 15:09

Léo Lam