Reader small image

You're reading from  Modern Frontend Development with Node.js

Product typeBook
Published inNov 2022
Reading LevelExpert
PublisherPackt
ISBN-139781804618295
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Florian Rappl
Florian Rappl
author image
Florian Rappl

Florian Rappl is a solution architect working on distributed web applications for digital transformation and IoT projects. His main interest lies in the implementation of micro frontends and their impact on teams and business models. As the lead architect he helped to create outstanding web applications for many industry leading companies. He regularly gives lectures on software design patterns and web development. Florian won multiple prizes for his work over the years and is recognized as a Microsoft MVP for development technologies. He started his career in software engineering before studying physics and helping to build an energy-efficient supercomputer. Florian currently lives in Munich, Germany, with his wife and two daughters.
Read more about Florian Rappl

Right arrow

Preface

This book covers everything necessary to make you use the power of Node.js, its concepts, and its ecosystem to the fullest. This includes everything you need to know about module systems, packages, helper libraries, CLI tools, WebAssembly, and a range of available tools such as bundlers (Webpack (v5), Parcel (v2), Vite, and esbuild), test runners (AVA, Jest, and Mocha), transpilers (Babel and TypeScript), and many more tools (Flow, Prettier, eslint, and Stylelint) are also covered.

Who this book is for

This book is for junior and intermediate-level frontend web developers who are looking to leverage the Node.js ecosystem for building frontend solutions. The book requires beginner-level knowledge of JavaScript, HTML, and CSS. Prior experience in using a standard shell (sh) will be beneficial.

What this book covers

Chapter 1, Learning about the Internals of Node.js, describes the inner workings of Node.js, its principles, and basic ideas. This chapter also makes you familiar with the essential Node.js command-line tooling.

Chapter 2, Dividing Code into Modules and Packages, introduces different module formats, their advantages and disadvantages, and their support within Node.js. The chapter also introduces the important package.json file for defining Node.js packages.

Chapter 3, Choosing a Package Manager, describes and compares the different established command-line utilities for installing and managing third-party dependencies in your Node.js packages.

Chapter 4, Using Different Flavors of JavaScript, covers the main concepts and ideas for using different flavors of JavaScript with Node.js. These flavors include Flow and TypeScript, but also more recent specifications of the ECMAScript standard than those supported by the currently available version of Node.js.

Chapter 5, Enhancing Code Quality with Linters and Formatters, covers the available utilities for improving the code quality of JavaScript projects. This chapter has information on how to install these code quality helpers, configure them, and have them integrated into standard workflows and development processes.

Chapter 6, Building Web Apps with Bundlers, discusses everything you need to know about dedicated web build tools known as bundlers. In this chapter, you will learn how state-of-the-art web projects are compiled from source code to artifacts that can be published on a server. The covered bundlers include Webpack, esbuild, Parcel, and Vite.

Chapter 7, Improving Reliability with Testing Tools, covers everything you need to know about testing with Node.js – from tools for running unit tests to full end-to-end test runners. In particular, the chapter includes elementary knowledge about Jest, Mocha, AVA, Playwright, and Cypress.

Chapter 8, Publishing npm Packages, contains useful information to publish and consume packages from the official npm registry or a custom private registry such as Verdaccio. The chapter also covers the creation and publishing of CLI tools with Node.js, as well as information about writing isomorphic libraries.

Chapter 9, Structuring Code in Monorepos, covers general strategies for the development of multiple dependent packages with Node.js. In particular, it goes into the details of working on multiple packages within a single repository known as a monorepo. Possible tools, such as Nx, Lerna, or Turbo, are introduced in combination with npm, Yarn, and pnpm workspaces.

Chapter 10, Integrating Native Code with WebAssembly, discusses the possibility of running native code compiled to WebAssembly. The chapter guides you through creating your first WebAssembly module, as well as running the created module in the browser and in Node.js.

Chapter 11, Using Alternative Runtimes, offers a detailed view of two alternatives to Node.js: Deno and Bun. Both are evaluated in terms of compatibility, security, performance, and stability.

To get the most out of this book

All the examples in the book have been created with simplicity in mind. They all work similarly and only require knowledge in core frontend technologies such as JavaScript with HTML and CSS. Additionally, some basic knowledge in using a terminal is necessary in order to follow all examples. The tooling to make the code run is discussed throughout the book. As such, if you know how to work with JavaScript, and follow the book explaining how to use Node.js with npm, you’ll have no problems running the examples presented in the book.

In Chapter 11, you’ll also run Deno and Bun. The chapter itself contains installation instructions.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Modern-Frontend-Development-with-Node.js. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in Action

The Code in Action videos for this book can be viewed at http://bit.ly/3EgcKwM.

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://packt.link/zqKz4.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”

A block of code is set as follows:

html, body, #map {
 height: 100%;
 margin: 0;
 padding: 0
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

Any command-line input or output is written as follows:

$ npm install

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Select System info from the Administration panel.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share your thoughts

Once you’ve read Modern Frontend Development with Node.js, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily!

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below:

https://packt.link/free-ebook/9781804618295

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Modern Frontend Development with Node.js
Published in: Nov 2022Publisher: PacktISBN-13: 9781804618295
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.
undefined
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 $15.99/month. Cancel anytime

Author (1)

author image
Florian Rappl

Florian Rappl is a solution architect working on distributed web applications for digital transformation and IoT projects. His main interest lies in the implementation of micro frontends and their impact on teams and business models. As the lead architect he helped to create outstanding web applications for many industry leading companies. He regularly gives lectures on software design patterns and web development. Florian won multiple prizes for his work over the years and is recognized as a Microsoft MVP for development technologies. He started his career in software engineering before studying physics and helping to build an energy-efficient supercomputer. Florian currently lives in Munich, Germany, with his wife and two daughters.
Read more about Florian Rappl