JS Ecosystem Overview
- Build Tools
- Basically compiling the code into a production-ready format.
- Test Tools
- Karma is a test runner that can run both Jasmine and Mocha-style tests.
- PhantomJS is a headless browser - it runs without GUI.
- nvm Node version manager. Facilitates managing different version of Node.js.
- Node.js is not a language; not a framework; not a tool. It is a runtime environment for running JS-based applications like JRE for Java.
- We have separate Node.js requirements for different platforms like Windows, Macintosh, and Linux and hence the JsVM.
Node.js also has a set of libraries which may otherwise be known as Node API or Node Modules to help run JS applications at runtime, similar to Java Libraries within the JRE.
- The JsVM takes this source code directly and compiles it to machine code specific to the given target platform for execution.
Web Application Architecture
- The client requests are handled by a single thread, but asynchronously. With Java, each client request is handled by a separate thread synchronously.
- There are many frameworks/libraries available for Node.js-based web application development. E.g., Express.js, Angular.js, Mongoose.js, etc.
- Client layer: Angular.js, a client-side MVC framework.
- Presentation + Service layer: can be developed by using Express.js. This also comes with a standalone server for running Node.js applications.
- Data layer: uses an Object Data Modelling module (e.g. Mongoose.js) for communicating with NoSQL databases like MongoDB.
- This particular stack is called MEAN stack , which consists of MongoDB, Express.js, Angular.js, and Node.js (the runtime environment)