On Wed, Oct 31, 2012 at 10:44 AM, Arunoda Susiripala <[email protected]> wrote: > Yes. I browserify does it. The video show's that. But what I suggest is it > will be cooler, we can bundle all the Node Core (if possible) into a single > JS file which using Chrome new APIS.
It's not possible to take the JS in node as-is and put it in a browser. Node consumes custom libuv C++ bindings that were designed for node, not browser dom APIs. This would be a new implementation of the node APIs on top of what the browser provides. > > What are the primitives which chrome is not possible to do? I have not much > experience in Node Core. And I'm referring to chrome (but not other browser) > which has native APIs for Socket API and so many others. Go through the node API, it's not that big. http://nodejs.org/api/ And for each item, find a corresponding browser API that provides the same abilities. Some problems I can see right away are: fs.*. I'm not aware of any browser API that lets web pages read and write a user's hard-drive net.* While there are tcp clients coming to browsers, I have yet to see any standard that allows binding to a port and listening on it. child_process.* I'm pretty sure the browser doesn't allow a web page to create arbitrary processes and execute them ... If you're ok with requiring your users to use a specefic browser, why not just use node-webkit or appjs and provide the webkit runtime for them with all of node embedded already? > > > > > On Wed, Oct 31, 2012 at 9:02 PM, Tim Caswell <[email protected]> wrote: >> >> On Wed, Oct 31, 2012 at 10:03 AM, Arunoda Susiripala >> <[email protected]> wrote: >> > Hi, >> > >> > I think with chrome we really don't need to much worry security model. >> > Since >> > chrome will take care of it. >> > What we actually need it set of wrappers for the core node APIs. >> > >> > Yes. we will not have to use npm projects with c/c++ add-ons, but still >> > we >> > can you alot, as mentioned in the video using browserify. >> >> >> Ok, so you're looking for a library that implements the node api in >> pure javascript. That's basically what browserify does. Do be aware >> that many node apis simply aren't possible to fully implement in the >> browser because the dom doesn't provide the primitives required. But >> as far as it's possible, it would be a neat project. You could even >> fake a lot of the impossible APIs and let people hook in mock >> providers. I've wanted to create something like this to let people >> run a node repl purely in the browser. >> >> > >> > >> > >> > On Wed, Oct 31, 2012 at 7:46 PM, Tim Caswell <[email protected]> wrote: >> >> >> >> Neat idea, but it's certainly not new. The hard part is actually >> >> making it work and finding a way to combine node's super open security >> >> model with that required to run in a web browser. >> >> >> >> If you just want to make desktop apps using nodejs + chrome's webkit >> >> the appjs and node-webkit projects are pretty active. Since they are >> >> desktop apps they don't have the sandbox security constraints of a web >> >> app. >> >> >> >> What's your plan for implementing the node runtime in chrome? It >> >> sounds very interesting. >> >> >> >> On Wed, Oct 31, 2012 at 9:06 AM, Arunoda Susiripala >> >> <[email protected]> wrote: >> >> > Hi Guys, >> >> > >> >> > Look at this amazing project: https://github.com/arunoda/chrome-node >> >> > >> >> > with the reference of running node in chrome - >> >> > http://www.youtube.com/watch?v=gkb_x9ZN0Vo&feature=g-all-lsb >> >> > >> >> > Cheers. >> >> > >> >> > -- >> >> > Arunoda Susiripala >> >> > >> >> > @arunoda >> >> > https://github.com/arunoda >> >> > http://www.linkedin.com/in/arunoda >> >> > >> >> > -- >> >> > Job Board: http://jobs.nodejs.org/ >> >> > Posting guidelines: >> >> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> >> > You received this message because you are subscribed to the Google >> >> > Groups "nodejs" group. >> >> > To post to this group, send email to [email protected] >> >> > To unsubscribe from this group, send email to >> >> > [email protected] >> >> > For more options, visit this group at >> >> > http://groups.google.com/group/nodejs?hl=en?hl=en >> >> >> >> -- >> >> Job Board: http://jobs.nodejs.org/ >> >> Posting guidelines: >> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> >> You received this message because you are subscribed to the Google >> >> Groups "nodejs" group. >> >> To post to this group, send email to [email protected] >> >> To unsubscribe from this group, send email to >> >> [email protected] >> >> For more options, visit this group at >> >> http://groups.google.com/group/nodejs?hl=en?hl=en >> > >> > >> > >> > >> > -- >> > Arunoda Susiripala >> > >> > @arunoda >> > https://github.com/arunoda >> > http://www.linkedin.com/in/arunoda >> > >> > -- >> > Job Board: http://jobs.nodejs.org/ >> > Posting guidelines: >> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> > You received this message because you are subscribed to the Google >> > Groups "nodejs" group. >> > To post to this group, send email to [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> > http://groups.google.com/group/nodejs?hl=en?hl=en >> >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en > > > > > -- > Arunoda Susiripala > > @arunoda > https://github.com/arunoda > http://www.linkedin.com/in/arunoda > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
