Node Cookbook
eBook - ePub

Node Cookbook

Discover solutions, techniques, and best practices for server-side web development with Node.js 14, 4th Edition

Bethany Griggs

Partager le livre
  1. 512 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Node Cookbook

Discover solutions, techniques, and best practices for server-side web development with Node.js 14, 4th Edition

Bethany Griggs

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Discover practical recipes to get to grips with Node.js concepts and programming models for delivering a scalable server-side for your applications

Key Features

  • Implement practical solutions for scaling, securing, and testing your Node.js web apps effectively
  • Build and deploy scalable microservices architecture with the power of Node.js 14
  • Discover techniques for debugging and testing Node.js applications

Book Description

A key technology for building web applications and tooling, Node.js brings JavaScript to the server enabling full-stack development in a common language. This fourth edition of the Node Cookbook is updated with the latest Node.js features and the evolution of the Node.js framework ecosystems.This practical guide will help you to get started with creating, debugging, and deploying your Node.js applications and cover solutions to common problems, along with tips to avoid pitfalls. You'll become familiar with the Node.js development model by learning how to handle files and build simple web applications and then explore established and emerging Node.js web frameworks such as Express.js and Fastify. As you advance, you'll discover techniques for detecting problems in your applications, handling security concerns, and deploying your applications to the cloud. This recipe-based guide will help you to easily navigate through various core topics of server-side web application development with Node.js.By the end of this Node book, you'll be well-versed with core Node.js concepts and have gained the knowledge to start building performant and scalable Node.js applications.

What you will learn

  • Understand the Node.js asynchronous programming model
  • Create simple Node.js applications using modules and web frameworks
  • Develop simple web applications using web frameworks such as Fastify and Express
  • Discover tips for testing, optimizing, and securing your web applications
  • Create and deploy Node.js microservices
  • Debug and diagnose issues in your Node.js applications

Who this book is for

The book is for web developers who have knowledge of JavaScript and want to gain a broad understanding of Node.js concepts for server-side development.

]]>

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Node Cookbook est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Node Cookbook par Bethany Griggs en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Programmation en JavaScript. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2020
ISBN
9781838554576

Chapter 1: Introducing Node.js 14

Node.js follows a release schedule and adopts a Long-Term Support (LTS) policy. The release schedule is based on the Semantic Versioning (https://semver.org/) standard.
The Node.js release policy states that there are two major releases of Node.js per year, one in April and one in October. Major releases include breaking or incompatible API changes, although the Node.js project does try to minimize the number and impact of breaking changes to reduce disruption to users.
Even-numbered major releases of Node.js are promoted to LTS after 6 months. Even-numbered releases are scheduled for release in April and promoted to LTS in October. LTS releases are supported for 30 months. It is recommended to use LTS versions of Node.js for production applications. The purpose of the LTS policy is to provide stability to end users and also to provide a predictable timeline of releases so that users can appropriately manage their upgrades. All LTS versions of Node.js are given codenames, named after elements. Node.js 14 has the LTS codename Fermium.
Odd-numbered major releases are released in October and are only supported for 6 months. Odd-numbered releases are expected to be used to try out new features and test the migration path, but are not generally recommended for use in production applications.
The Node.js Release Working Group has authority over the Node.js release schedule and processes. The Node.js release schedule and policy documentation can be found at https://github.com/nodejs/release.
This chapter introduces Node.js – including instructions on how to install the runtime and access the API documentation.
This chapter will cover the following recipes:
  • Installing Node.js 14 with nvm
  • Accessing the Node.js API documentation
  • Adopting new JavaScript syntax in Node.js 14

Technical requirements

This chapter will require access to a Terminal, a browser of your choice, and the internet.

Installing Node.js 14 with nvm

This book will be using Node.js 14 throughout, as it is the latest LTS release at the time of writing. Node.js 14 was released in April 2020, was promoted to LTS in October 2020 and will continue to be supported until April 2023. This recipe will cover how to install Node.js 14 using node version manager (nvm). At the time of writing, nvm is an incubation project of the OpenJS Foundation and provides an easy way to install and update Node.js versions.

Getting ready

You will need to have the appropriate permissions on your device to install nvm. This recipe assumes you're on a UNIX-like platform. If you're on Windows, it should be run under Windows Subsystem for Linux (WSL).

How to do it


In this recipe, we're going to be installing Node.js 14 using nvm:
  1. First, we need to install nvm. nvm provides a script that handles the download and installation of nvm. Enter the following command in your Terminal to execute the nvm installation script:
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
  2. nvm will automatically attempt to add itself to your path. Close and reopen your Terminal to ensure the changes have taken place. Then, enter the following command to list the nvm version we have installed; this will also confirm that nvm is available in our path:
    $ nvm --version
    0.37.0
  3. To install Node.js 14, we use the $ nvm install command. We can supply either the specific version we wish to install or the major version number. If we specify just the major version number, nvm will install the latest release of that major release line. Enter the following command to install the latest version of Node.js 14:
    $ nvm install 14
    Downloading and installing node v14.6.0...
    Local cache found: ${NVM_DIR}/.cache/bin/node-v14.6.0-darwin-x64/node-v14.6.0-darwin-x64.tar.gz
    Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/bin/node-v14.6.0-darwin-x64/node-v14.6.0-darwin-x64.tar.gz
    Now using node v14.6.0 (npm v6.14.6)
    Note that this command will install the latest version of Node.js 14, so your specific version install is likely to differ from that shown in the preceding output.
  4. The latest Node.js 14 version should now be installed and available in your path. You can confirm this by entering the following command:
    $ node --version
    v14.6.0
  5. nvm will also install the version of npm that is bundled with the Node.js version you have installed. Enter the following to confirm which version of npm is installed:
    $ npm --version
    6.14.6
  6. nvm makes it easy to install and switch between multiple Node.js versions. We can enter the following to install and switch to the latest Node.js 12 version:
    $ nvm install 12
    Downloading and installing node v12.18.3...
    Local cache found: ${NVM_DIR}/.cache/bin/node-v12.18.3-darwin-x64/node-v12.18.3-darwin-x64.tar.gz
    Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/bin/node-v12.18.3-darwin-x64/node-v12.18.3-darwin-x64.tar.gz
    Now using node v12.18.3 (npm v6.14.6)
  7. Once we've got the versions installed, we can use the $ nvm use command to switch between them:
    $ nvm use 14
    Now using node v14.6.0 (npm v6.14.6)
We've installed the latest version of Node.js 14 using nvm.

How it works


nvm is a version manager for Node.js on UNIX-like platforms and supports POSIX-compliant shells. POSIX is a set of standards for operating system co...

Table des matiĂšres