Node.js Design Patterns - Second Edition
eBook - ePub

Node.js Design Patterns - Second Edition

Mario Casciaro, Luciano Mammino

Share book
  1. 526 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Node.js Design Patterns - Second Edition

Mario Casciaro, Luciano Mammino

Book details
Book preview
Table of contents
Citations

About This Book

Get the best out of Node.js by mastering its most powerful components and patterns to create modular and scalable applications with easeAbout This Book• Create reusable patterns and modules by leveraging the new features of Node.js.• Understand the asynchronous single thread design of node and grasp all its features and patterns to take advantage of various functions.• This unique guide will help you get the most out of Node.js and its ecosystem.Who This Book Is ForThe book is meant for developers and software architects with a basic working knowledge of JavaScript who are interested in acquiring a deeper understanding of how to design and develop enterprise-level Node.js applications.Basic knowledge of Node.js is also helpful to get the most out of this book.What You Will Learn• Design and implement a series of server-side JavaScript patterns so you understand why and when to apply them in different use case scenarios• Become comfortable with writing asynchronous code by leveraging constructs such as callbacks, promises, generators and the async-await syntax• Identify the most important concerns and apply unique tricks to achieve higher scalability and modularity in your Node.js application• Untangle your modules by organizing and connecting them coherently• Reuse well-known techniques to solve common design and coding issues• Explore the latest trends in Universal JavaScript, learn how to write code that runs on both Node.js and the browser and leverage React and its ecosystem to implement universal applicationsIn DetailNode.js is a massively popular software platform that lets you use JavaScript to easily create scalable server-side applications. It allows you to create efficient code, enabling a more sustainable way of writing software made of only one language across the full stack, along with extreme levels of reusability, pragmatism, simplicity, and collaboration. Node.js is revolutionizing the web and the way people and companies create their software.In this book, we will take you on a journey across various ideas and components, and the challenges you would commonly encounter while designing and developing software using the Node.js platform. You will also discover the "Node.js way" of dealing with design and coding decisions.The book kicks off by exploring the basics of Node.js describing it's asynchronous single-threaded architecture and the main design patterns. It then shows you how to master the asynchronous control flow patterns, and the stream component and it culminates into a detailed list of Node.js implementations of the most common design patterns as well as some specific design patterns that are exclusive to the Node.js world.Lastly, it dives into more advanced concepts such as Universal Javascript, and scalability' and it's meant to conclude the journey by giving the reader all the necessary concepts to be able to build an enterprise grade application using Node.js.Style and approachThis book takes its intended readers through a comprehensive explanation to create a scalable and efficient real-time server-side apps.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Node.js Design Patterns - Second Edition an online PDF/ePUB?
Yes, you can access Node.js Design Patterns - Second Edition by Mario Casciaro, Luciano Mammino in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785887383
Edition
2

Node.js Design Patterns - Second Edition


Node.js Design Patterns - Second Edition

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2014
Second edition: July 2016
Production reference: 1110716
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B32PB, UK.
ISBN 978-1-78588-558-7
www.packtpub.com

Credits

Authors
Mario Casciaro
Luciano Mammino
Copy Editor
Safis Editing
Reviewers
Tane Piper
Joel Purra
Project Coordinator
Ulhas Kambali
Commissioning Editor
Amarabha Banerjee
Proofreader
Safis Editing
Acquisition Editor
Reshma Raman
Indexer
Mariammal Chettiyar
Content Development Editor
Onkar Wani
Graphics
Kirk D'Penha
Technical Editor
Prajakta Mhatre
Production Coordinator
Nilesh Mohite

About the Authors

Mario Casciaro is a software engineer and entrepreneur, passionate about technology, science and open source knowledge. Mario graduated with a master's degree in software engineering and started his professional career at IBM where he worked for several years on different enterprise products such as Tivoli Endpoint Manager, Cognos Insight, and SalesConnect. Next, he moved to D4H Technologies, a growing SaaS company, to lead the development of a new bleeding-edge product for managing emergency operations in real time. Currently, Mario is the co-founder and CEO of Sponsorama.com, a platform to help online projects raise funds through corporate sponsorship.
Mario is also the author of the first edition of Node.js Design Patterns.

Acknowledgments

When I was working on the first edition of this book I would never have thought it would become such a success. My biggest thanks go to all the readers of the first edition of this book, to those who bought it, to those who left a review, and to those who recommended it to their friends on Twitter or on other online forums. And of course, my gratitude also goes to the readers of this second edition; to you who are reading these words, you make all our efforts worthwhile. I also want you to join me in congratulating my friend Luciano, the co-author of this second edition, who did a tremendous job updating and adding new invaluable content to this book. All the merit goes to him as I only had the role of adviser in this second edition. Working on a book is not an easy task, but Luciano impressed me and all the staff at Packt for his dedication, professionalism, and technical skills, demonstrating he can achieve any goal he sets his mind to. It was a pleasure and a honor working with Luciano and I'm looking forward to other great collaborations. I also want to thank all the people who worked on the book, the folks of Packt, the technical reviewers (Tane and Joel) and all the friends who provided valuable suggestions and insights: Anton Whalley (@dhigit9), Alessandro Cinelli (@cirpo), Andrea Giuliano (@bit_shark), and Andrea Mangano (@ManganoAndrea). Thanks to all the friends who give me unconditional love, to my family, and most importantly to my girlfriend Miriam, the partner of all my adventures, who brings love and joy in every day of my life. There are still a hundred thousand adventures awaiting us.

About the Author

Luciano Mammino is a software engineer born in 1987, the same year that the Nintendo released Super Mario Bros in Europe, which by chance is his favorite video-game. He started coding at the age of 12 using his father's old Intel 386, provided only with the DOS operating system and the qBasic interpreter.
After a master's degree in computer science he developed his programming skills mostly as a web developer working mainly as freelancer for companies and startups all around Italy. After a start-up parenthesis of 3 years as CTO and co-founder of Sbaam.com in Italy and in Ireland, he decided to relocate in Dublin to work as senior PHP engineer at Smartbox.
He loves developing open source libraries and working with frameworks such as Symfony and Express. He is convinced that the JavaScript fame is still at the very beginning and that this technology will have a huge impact in the future of most of the web-and mobile-related technologies. For this reason, he spends most of his free time improving his knowledge of JavaScript and playing with Node.js.

Acknowledgments

The first huge thanks go to Mario for giving me the opportunity and the trust to work alongside him on the new edition of this book. It was an amazing experience and hopefully just the beginning of a long series of collaborations.
This book was only possible thanks to the incredible and efficient work of the Packt team, especially thanks to the relentless efforts and the patience of Onkar, Reshma, and Prajakta. Also thanks to the reviewers Tane Piper and Joel Purra, their experience with Node.js was crucial to raise the quality of the content provided in this book.
A great hug (and many beers) go to my friends Anton Whalley (@dhigit9), Alessandro Cinelli (@cirpo), Andrea Giuliano (@bit_shark), and Andrea Mangano (@ManganoAndrea) for encouraging me all along the way, for sharing with me their experience as developers and for providing meaningful insights on the contents of this book.
Another great thank you goes to Ricardo, Jose, Alberto, Marcin, Nacho, David, Arthur, and all my colleagues at Smartbox for making me love my days at work and for inspiring and motivating me to get better every day as a software engineer. I couldn't ask for a better team.
My deepest gratitude goes to my family, who raised and sustained me in every possible way along my journey. Thanks, mom, for being a constant source of inspiration and strength in my life. Thanks, dad, for all the lessons, the encouragement and the advice, I really miss talking with you, I really miss you. Thanks to my brother Davide and my sister Alessia for being present in the painful and the joyful moments and making me feel part of a great family.
Thanks to Franco and his family for supporting many of my initiatives and for sharing their wisdom and life experience with me.
Kudos to my "nerd" friends Gianluca, Flavio, Antonio, Valerio, and Luca for the great time together and for constantly encouraging me to keep working on this book.
Also kudos to my "less nerdy" friends Damiano, Pietro, and Sebastiano for their friendship and all the laughs and the fun we have when we hang out together in Dublin.
Last, but definitely not least, thanks to my girlfriend Francesca. Thank you for the unconditioned love and for supporting me on every adventure, even the craziest ones. I really look forward to writing the next pages in the book of our life with you.

About the Reviewers

Tane Piper is a full stack developer based in London, UK. For over 10 years He has worked for several agencies and companies delivering software in a variety of languages such as Python, PHP, and JavaScript. He has been working with Node.js since 2010 and was one of the first people talking about server-side JavaScript in the UK and Ireland with several talks in 2011/2012. He was also an early contributor to, and advocate for the jQuery project. Currently he works at a consultancy in London delivering innovative solutions and is mostly writing React and Node applications. Outside of his professional work he is a keen scuba diver and amateur photographer.
I would personally like to thank my girlfriend Elina who has turned my life around in the last two years and encouraged me to take up the task of reviewing this book.
Joel Purra started toying around with computers even before he was in his teens, seeing them as another kind of a video game device. It was not long before he took apart (sometimes broke and subsequently fixed...

Table of contents