Netbeans 8.1 HTML5/JavaScript Project Types

953 views Asked by At

I want to create a new HTML5/JS project in Netbeans 8.1. Here is a picture of my options:

enter image description here

I am struggling with getting definitions for these projects (even in Netbeans documentation). I mean there is a brief definition for these projects but that is just not enough information for a beginner.


HTML5/JS Application                Creates a new HTML5/Javascript application configured for HTML, CSS and JavaScript.
Node.js Application                 Creates a new Node.js application configured for Node.js, HTML, CSS and JavaScript.
HTML5/JS Application with Node.js   Creates a new HTML5 application configured for Node.js (possibly with Express framework), HTML, CSS and JavaScript.
JavaScript Library                  Creates a new JavaScript library in a standard IDE project.

1) What is an HTML5/JS application project used for?

2) What is a Node.js application project used for?

3) What is an HTML5/JS application project with Node.js used for?

4) If I want to create an HTML5/JS component that can be used in other web pages, should I use the JavaScript Library project?

Can someone please either explain the differences or point me to some helpful documentation? I've been searching for a couple of hours now and cannot find the specifics I am looking for. Just a simple explanation of why to use each of the project types I've listed above. I know what "with Existing Sources" means and that Cordova Application is for mobile apps.

Thank you in advance for helping clear up my confusion!

1

There are 1 answers

0
ladar On BEST ANSWER

Here is a bit of explanation

  1. HTML5/JS - general a client-side project without any server side code. IDE will give you a lightweight http server to run the project on it (or you can provide own server and then IDE will open configured URL in browser). It has Site root where your client side sources are placed
  2. Node.js application - general NodeJS project. Note that NodeJS is not just for HTTP server, but it is a platform for variaty of projects (scripts, servers, etc.). The "run action" on the project will run JS file on nodejs rather than opening a web browser. It has "Sources" where your sources are placed
  3. HTML5/JS application project with Node.js - combination of the above with both Site root and Sources. Typical usecase is ExpressJS application with server side logic (NodeJS) and client side sources. It has a run action that will run JS file on Node and could also open URL in browser.

Please note that generally speaking, the main (perhaps only) difference is in project sources configuration (Sources, Site Root) and how the project is being run (browser, NodeJS script, both). This allows users to have some kind of "project configuration template" out of the box.

But you can change all this configuration if you right click on your project and open Project Properties. There you can change basically any of these project types to a different one (from the same category in the wizard).

The "JavaScript Library" is a imho a project without any run configuration.

As for the #4, it is up to you to decide what will suite you better :) Except of JS Library and Cordova, they should all work for you and you can always change your project setting to a different ones if desired.