流星有REPL吗?

Zek*_*eke 16 node.js read-eval-print-loop meteor

Meteor框架是否附带某种REPL或控制台?如果没有,任何想法如何以引导Meteor环境的方式使用Node.js REPL

我基本上在寻找类似rails控制台或web浏览器中的javascript控制台的东西:一个命令行界面,它使应用程序的完整上下文可用,所以我可以任意检查像Meteor和的对象Template.

Léo*_*Lam 17

是的,从版本1.0.2开始,Meteor有一个REPL.

简单地用于meteor shell删除REPL,这与Node非常相似.

$ 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
> 
Run Code Online (Sandbox Code Playgroud)

您将可以访问完整的Meteor环境,代码将像服务器端代码一样运行.

  • 请注意,Meteor服务器需要运行,它不会弹出一个. (2认同)

Zek*_*eke 9

Meteor目前没有REPL,但它在路线图上.在此期间,您可以在浏览器的javascript控制台中访问应用程序中面向客户端的部分.

  • 这个答案现在已经过时了.Meteor确实有服务器端REPL,请参阅下面的LéoLam的回答! (2认同)