客户端计算机中的Node Js应用程序 [英] Node Js application in client machine

查看:58
本文介绍了客户端计算机中的Node Js应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个Node js应用程序,无论使用什么操作系统,它都可以在每台机器上本地运行.例如,如果我在节点js中构建待办事项"列表应用程序,则当我在浏览器中键入www.todo.app时,待办事项"应用程序应运行.我尝试使用Electron Js进行应用程序,但是问题是,它占用了机器中的额外内存.我知道Electron与内置的chrome浏览器一起运行.如果我已经在计算机中安装了chrome浏览器,为什么Electron应该在该计算机中安装另一个chrome.

I would like to make a Node js application that runs locally in every machine regardless of Operating System used. For example, if I build a To Do listing application in node js, when I type www.todo.app in a browser, the To Do application should run. I tried Electron Js to make application, but the problem is that, it takes extra memory in machine. I know Electron runs with the inbuilt chrome browser. If I have already installed chrome browser in the machine, why should Electron install another chrome in that machine.

所以,我的问题是,是否有机会制作在机器浏览器中本地运行的node js应用程序.

So, my question is, if I have any opportunity to do a node js application that runs locally in a machines browser.

推荐答案

这里根本有太多问题.

我尝试用Electron Js进行应用,但是问题在于,它占用了机器中的额外内存.

I tried Electron Js to make application, but the problem is that, it takes extra memory in machine.

尽管电子应用程序的内存消耗通常比高度优化的本机应用程序大,但它可与独立运行chrome媲美.因此,如果用户使用chrome浏览Web应用程序,则从电子切换到基于节点的应用程序(该用户需要在本地运行)不会在内存方面特别为您节省很多费用.

While the memory consumption of electron application is usually larger than highly optimized native applications, it is comparable to running chrome standalone. So switching from electron to a node based application (which user would need to run locally) does not save you a lot in terms of memory esp if the user uses chrome to view the web application.

如果我已经在计算机上安装了chrome浏览器,为什么Electron应该在该计算机上安装另一个chrome.

If I have already installed chrome browser in the machine, why should Electron install another chrome in that machine.

基本上,捆绑运行时可确保您可以控制应用程序中正在使用的chrome版本,而不管用户在其计算机上安装了什么.

Basically, bundling the runtime ensures that you can control the version of chrome in use in your application regardless of what the user has installed in his/her machine.

这也意味着您要测试的浏览器引擎是用户使用的浏览器引擎(在所有平台上).

This also means that the browser engine you test against, is the browser engine that the user uses (on all platforms).

某些项目,例如 electrino 试图通过使用已安装的台式机电子浏览器引擎来解决此问题.应用程序,但据我所知,这些工作还没有准备就绪.

Some projects like electrino have attempted to address this by using the installed browser engine for electron like desktop applications, but as far as I know none of these efforts are production ready yet.

所以,我的问题是,是否有机会制作在机器浏览器中本地运行的node js应用程序.

So, my question is, if I have any opportunity to do a node js application that runs locally in a machines browser.

综上所述,没有什么真正阻止您构建和分发基于节点的Web应用程序.

Having said all of the above, there is nothing really preventing you from building and distributing a node based web applications.

对于面向技术(或技术倾向)用户的应用程序,人们通常以npm软件包或平台特定的软件包管理器(例如,针对Windows的Scoop,针对Mac的自制软件,针对Linux的快照等)分发这些应用程序.

For application targeted at technical (or technically inclined) users people usually distribute these applications either as npm packages or platform specific package managers (eg. scoop for windows, homebrew for mac, snaps for linux etc.).

您还可以使用诸如zeit的 pkg 之类的解决方案将应用程序分发为独立的二进制文件.

You can also use a solution like zeit's pkg to distribute your application as a standalone binary.

据我所知,任何用于台式机操作系统的应用程序商店都不允许分发Web应用程序.

As far as I can tell, any app store for desktop operating systems will not allow distribution of web applications.

这篇关于客户端计算机中的Node Js应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆