Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Node.js Web Development

You're reading from   Node.js Web Development Create real-time server-side applications with this practical, step-by-step guide

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785881503
Length 376 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
David Herron David Herron
Author Profile Icon David Herron
David Herron
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. About Node.js FREE CHAPTER 2. Setting up Node.js 3. Node.js Modules 4. HTTP Servers and Clients – A Web Application's First Steps 5. Your First Express Application 6. Implementing the Mobile-First Paradigm 7. Data Storage and Retrieval 8. Multiuser Authentication the Microservice Way 9. Dynamic Interaction between Client and Server with Socket.IO 10. Deploying Node.js Applications 11. Unit Testing Index

Preface

Welcome to the world of software development on the Node.js platform. This is an up-and-coming software platform that liberates JavaScript from the web browser, allowing us to reuse our JavaScript skills for general software development on a large range of systems. It runs atop the ultra-fast JavaScript engine at the heart of Google's Chrome browser, V8, and adds a fast and robust library of asynchronous network I/O modules. The Node.js community have developed a dizzyingly large body of third-party modules for nearly every conceivable purpose. While the primary focus of Node.js is high performance highly-scalable web applications, it is seeing widespread use in Internet of Things (IoT) applications, microservice development, asset build workflow for frontend engineers, and even in desktop applications like the Atom editor.

Microservices are one of the brightest ideas in computing today, and Node.js is right there as one of the best platforms for microservice development. This is doubly true when combined with Docker.

In just a few years, Node.js has gone from being a brand new "will anyone adopt it" technology to a major force in software development. It is now widely used in companies big and small, and the MEAN Stack (MongoDB, Express, AngularJS, and Node.js) has become a leading application model.

The Node.js platform was developed by Ryan Dahl in 2009 after a couple years of experimenting with web server component development in Ruby and other languages. His goal was to create an event-oriented system with a low-overhead architecture. This led Dahl toward an asynchronous single-thread system, as opposed to a more traditional thread-based architecture.

This model was chosen for simplicity, under the theory that threaded systems are notoriously difficult to develop and debug for lower overhead and for speed. Node.js's goal is to provide "an easy way to build scalable network servers." The design is similar to, and influenced by, other systems, such as Event Machine (Ruby) and the Twisted framework (Python).

JavaScript was chosen as the language because anonymous functions and other language elements provide an excellent base to implement asynchronous computation. Event handler functions are often coded in-line as anonymous functions. The Node.js runtime is ingeniously designed to support asynchronous I/O operations.

Now that ECMA Script 2016 is on the scene, new features, such as arrow functions and Promises, are coming to JavaScript engines, including Node.js. These powerful new capabilities will change JavaScript programming for the better. We now have a path toward taming some of the difficulties with asynchronous coding. The Promise object gives us a way to organize asynchronously-executed procedures in a semi-linear sequence, rather than the pyramid-shaped structures of callback functions.

The result is a platform that allows developers to not only succinctly write code of great power but to have a lot of fun while doing so.

Having JavaScript on both the server and the client (browser) lets us implement a vision dating back to the earliest days of the World Wide Web. Java's proponents first showed us dynamic stuff, powered by Java, running inside a web page. With Java on both client and server side, developers were supposed to reach nirvana. Java did not achieve success promoted by Sun Microsystems. Instead, it is JavaScript that is quickly advancing to implement that vision in a big way.

With Node.js, we have JavaScript on both the client and the server. While this probably won't help developers reach nirvana, our work is made much easier. We can use common code, common data structures, and more team members speak the same code language.

This book, Node.js Web Development, Third Edition, focuses on building web applications using Node.js. We assume that you have some knowledge of JavaScript and maybe even have server-side development experience. We will take a tour through the important concepts in order to understand Node.js programming.

To do so, we'll develop several applications, including a Note-taking application that will take several chapters to implement data storage with several database engines, user authentication, including OAuth2 against Twitter, real-time communications between users, and server deployment, including Docker. Along the way, we'll explore leading application development best practices, distributing heavy workloads to backend servers, and implementing REST microservices for multitiered architectures.

lock icon The rest of the chapter is locked
Next Section arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime