且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

node.js 与meteor.js 有什么区别?

更新时间:2023-12-04 12:22:34

一个松散的类比是,Meteor 之于 Node,就像 Rails 之于 Ruby."这是一个大型的、固执己见的框架,在服务器上使用 Node.Node 本身只是一个底层框架,提供发送和接收 HTTP 请求和执行其他 I/O 的功能.

A loose analogy is, "Meteor is to Node as Rails is to Ruby." It's a large, opinionated framework that uses Node on the server. Node itself is just a low-level framework providing functions for sending and receiving HTTP requests and performing other I/O.

Meteor 雄心勃勃:默认情况下,它服务的每个页面实际上都是一个与服务器保持同步的 Handlebars 模板.试试排行榜示例:您创建一个模板,上面写着列出姓名和分数",并且每次任何客户发生变化时名称或分数,页面会使用新数据进行更新 - 不仅针对该客户,而且针对查看该页面的每个人.

Meteor is radically ambitious: By default, every page it serves is actually a Handlebars template that's kept in sync with the server. Try the Leaderboard example: You create a template that simply says "List the names and scores," and every time any client changes a name or score, the page updates with the new data—not just for that client, but for everyone viewing the page.

另一个区别:虽然 Node 本身很稳定并且广泛用于生产,但 Meteor 处于预览"状态.存在严重的错误,并且某些不符合 Meteor 以数据为中心的概念模型(例如动画)的东西很难做到.

Another difference: While Node itself is stable and widely used in production, Meteor is in a "preview" state. There are serious bugs, and certain things that don't fit with Meteor's data-centric conceptual model (such as animations) are very hard to do.

如果您喜欢玩新技术,不妨试试 Meteor.如果您想要一个基于 Node 构建的更传统、更稳定的 Web 框架,请查看 Express.

If you love playing with new technologies, give Meteor a spin. If you want a more traditional, stable web framework built on Node, take a look at Express.