In my opinion, Node's biggest advantage today is the absolutely massive module ecosystem that has sprung up around it in record time. It's already the biggest, as well as the fastest growing according to http://www.modulecounts.com/ You can find a package for almost everything imaginable, and your typical Node app is made up of dozens of these modules. So take a look at https://www.npmjs.com/, and try searching for whatever field interests you.
Ask HN: Why Node.js and for which type of App?
11–20 of 49 posts
Re: Ask HN: Why Node.js and for which type of App?
#12EDIT: Clarify with "CPU/disk intensive operations"
Re: Ask HN: Why Node.js and for which type of App?
#13TL;DR: Apps that perform high I/O. For example, if your app is just getting data from a database and returning it to the user, 90% of your time will be spent: * Receiving the user's request (Network, IO) * Fetching something from the DB (Network, IO) * Returning the data (Network, IO) That's a good scenario for an event based system like Node.js. Try not to use node.js if you're CPU-bound: rendering images or PDF, pr…
So, you would use node.js just as a service to process data on the server side and not as a application for the desktop (with a gui)?
Re: Ask HN: Why Node.js and for which type of App?
#14Re: Ask HN: Why Node.js and for which type of App?
#15Node.js in itself is a wrapper around V8, the JavaScript engine of Google Chrome. It is used to execute JavaScript on the server for example to implement REST APIs. I would consider Node.js if you implement actual webbased software because you could take advantage of a shared codebase. If you want to display content on the internet there are more comfortable alternatives you could use. What you are probably looking f…
Hi there, thanks for your response. I programmed some Desktop Apps with Java and C#. And during some hackathons i used python+flask+nginx to implement a Web-Applications with a RestAPI on the backend. I was just curious for which type of application i can use node.js (since i didn't use javascript on the backend at all). Usually i used PHP, C# or Pyhton for the backend.. Is MS Windows 10 using node.js for their appli…
Re: Ask HN: Why Node.js and for which type of App?
#16Node is a tool for running Javascript on the server. Your desire to use it will stem entirely upon your desire to write javascript to perform server side tasks. There are many languages and environments for running code on the server, so I personally have problems finding a niche where Javascript is the obviously better choice for these tasks. In my experience with it so far, it's "fast enough" for IO bound tasks (ro…
Now that's often what people think of Node.js, but that's not really why Node.js is interesting. It's not just "JavaScript on the browser".
Instead, you should think of Node.js more like a JavaScript binding to `libuv`, which is the C library that provides the event-driven I/O core (event loop / queue). (An example for a `libuv` binding in another language, Lua would be `luv` [1].)
Reasons why JavaScript was picked for Node.js: 1) It already dealt with events due to its usage in browsers and 2) a fast existing JIT runtime, V8.
To answer the original question: You might want to use Node.js if your problem is a good fit for the Reactor pattern [2]. For example, scalable network services that "mediate" between a lot of (async) I/O. Not number crunching. Nginx uses the same core concept (Reactor).
Re: Ask HN: Why Node.js and for which type of App?
#17TL;DR: Apps that perform high I/O. For example, if your app is just getting data from a database and returning it to the user, 90% of your time will be spent: * Receiving the user's request (Network, IO) * Fetching something from the DB (Network, IO) * Returning the data (Network, IO) That's a good scenario for an event based system like Node.js. Try not to use node.js if you're CPU-bound: rendering images or PDF, pr…
Thanks! So, you would use node.js just as a service to process data on the server side and not as a application for the desktop (with a gui)?
However, there is growing discussion about using Node.js for desktop applications. Please see https://nodesource.com/blog/node-desktop-applications
Re: Ask HN: Why Node.js and for which type of App?
#18Making restful APIs is quite fun with it, though.
Re: Ask HN: Why Node.js and for which type of App?
#19npm[0], Node.js's package manager, is also pretty useful. There's a package to do most things.
Yes, there's some projects that let you create desktop applications using Node.js - what they're doing is using an embedded version of Chrome and pairing it with Node.js. You can then use HTML and CSS to create a user-interface that you can then manipulate with JavaScript. You end up with a fairly bloated distributable application, but the JavaScript code runs on Mac, Windows and Linux.
NodeSchool[1] seems to be the recommended learning resource for Node.js. I've never really used it, but it looks pretty good.
Re: Ask HN: Why Node.js and for which type of App?
#20For example, I share the physics code which is responsible for controlling the simulation that runs on both the server (authoritative) and clients (for predictions).
I no longer have to switch languages which also saves a lot of time!