Node.js: Novice to Ninja
166 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Node.js: Novice to Ninja , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
166 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Node.js: Novice to Ninja is your hands-on guide to learning everything needed to build a professional web application using Node.js, the hugely popular open-source, cross-platform, back-end JavaScript runtime environment. You'll start off by getting familiar with the basics - installation and building your first apps - before moving onto more advanced concepts, including debugging, asynchronous programming, using Express.js, working with databases, deployment, and more. You'll finish by building a complete multi-player real-time quiz application.


  • Install Node and build your first application
  • Get started with Express.js and use it to process forms
  • Master asynchronous programming in Node.js
  • Work with MongoDB and MySQL databases
  • Use WebSockets for real-time applications
  • Understand the Node ecosystem: npm and modules
  • Build a complete multiplayer quiz app
  • And much more!

The book includes access to 25 high quality tutorial videos, containing 1.5 hours of content.


Sujets

Informations

Publié par
Date de parution 07 juin 2022
Nombre de lectures 2
EAN13 9781098141011
Langue English
Poids de l'ouvrage 1 Mo

Informations légales : prix de location à la page 0,1450€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

Node.js: Novice to Ninja
Copyright © 2022 SitePoint Pty. Ltd.
Ebook ISBN: ISBN 978-1-925836-53-0 Product Manager: Simon Mackie Technical Editor: Ivaylo Gerchev English Editor: Ralph Mason Cover Designer: Alex Walker
Notice of Rights
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 embodied in critical articles or reviews.
Notice of Liability
The author and publisher have made every effort to ensure the accuracy of the information herein. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors and SitePoint Pty. Ltd., nor its dealers or distributors will be held liable for any damages to be caused either directly or indirectly by the instructions contained in this book, or by the software or hardware products described herein.
Trademark Notice
Rather than indicating every occurrence of a trademarked name as such, this book uses the names only in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of the trademark.

Published by SitePoint Pty. Ltd.
10-12 Gwynne St, Cremorne, VIC, 3121 Australia Web: www.sitepoint.com Email: books@sitepoint.com

About SitePoint
SitePoint specializes in publishing fun, practical, and easy-to-understand content for web professionals. Visit http://www.sitepoint.com/ to access our blogs, books, newsletters, articles, and community forums. You’ll find a stack of information on JavaScript, PHP, design, and more.
About the Author
Craig is a UK-based freelance full-stack web developer, writer, and speaker who’s passionate about standards and performance.
He began coding in the 1980s and started client-side JavaScript development on its release in 1995 when DHTML, spacer GIFs, and marquees were considered sophisticated. You may have encountered his work at SitePoint, where he’s written more than 1,200 tutorials, and books including Jump Start Web Performance , Browser DevTool Secrets , and Docker for Web Developers .
Craig used Node.js from the start and hopes this book is a great first step on your server-side JavaScript journey. Contact him on Twitter @craigbuckler or at craigbuckler.com.

Preface
This book will help you get started with Node.js in the shortest possible time. Within a day or two you should have enough knowledge to write simple applications.
Prerequisites
This book is for web developers taking their first steps with Nodes.js. Ideally, you should understand web development concepts and technologies: web browsers (client-side HTML, CSS, and JavaScript) web servers (code to serve web pages and APIs)
It will help if you already know some JavaScript—perhaps from writing client-side scripts. This book explains some aspects of JavaScript in relation to Node.js, but you won’t find deep dives into variables, loops, functions, objects, and so on.
A little knowledge of the command line, Git, and code editors such as VS Code will also be useful.
Conventions Used
Code Samples
Code in this book is displayed using a fixed-width font, like so:
<h1>A Perfect Summer's Day</h1><p>It was a lovely day for a walk in the park.The birds were singing and the kids were all back at school.</p>
Some lines of code should be entered on one line, but we’ve had to wrap them because of page constraints. An ➥ indicates a line break that exists for formatting purposes only, and should be ignored:
URL.open("https://www.sitepoint.com/responsive-web-➥design-real-user-testing/?responsive1");
You’ll notice that we’ve used certain layout styles throughout this book to signify different types of information. Look out for the following items.
Tips, Notes, and Warnings

Hey, You!

Tips provide helpful little pointers.

Ahem, Excuse Me ...

Notes are useful asides that are related—but not critical—to the topic at hand. Think of them as extra tidbits of information.

Make Sure You Always ...

... pay attention to these important points.

Watch Out!

Warnings highlight any gotchas that are likely to trip you up along the way.
Where to Find Help
PHP and MySQL are moving targets, so chances are good that, by the time you read this, some minor detail or other of these technologies has changed from what’s described in this book. Thankfully, SitePoint has a thriving community of PHP developers ready and waiting to help you out if you run into trouble, and we also maintain a list of known errata for this book you can consult for the latest updates.
The SitePoint Forums
The SitePoint Forums are discussion forums where you can ask questions about anything related to web development. You may, of course, answer questions, too. That’s how a discussion forum site works—some people ask, some people answer, and most people do a bit of both. Sharing your knowledge benefits others and strengthens the community. A lot of fun and experienced web designers and developers hang out there. It’s a good way to learn new stuff, have questions answered in a hurry, and just have fun.
The SitePoint Forums include separate forums for PHP and MySQL: PHP Databases & MySQL
The Code Archive
As you progress through this book, you’ll note a number of references to the code archive . This is a GitHub repository that contains each and every line of example source code that’s printed in this book. If you want to cheat (or save yourself from carpal tunnel syndrome), go ahead and download the archive . Select the example from the dropdown that says Branch , then choose Clone or Download , and you can download a .zip file for that example.
Alternatively, if you’re familiar with Git, you can clone the repository.
Your Feedback
If you’re unable to find an answer through the forums, or if you wish to contact us for any other reason, the best place to write is books@sitepoint.com . We have a well-staffed email support system set up to track your inquiries, and if our support team members are unable to answer your question, they’ll send it straight to us. Suggestions for improvements, as well as notices of any mistakes you may find, are especially welcome. You can also report and discuss issues in the book’s GitHub repository.
Let’s Go
Now that I’ve introduced myself, given you some broad tips, and shown you where to find help, it’s time to get started! You’ll begin by setting up a development environment, and you’ll be writing your first lines of code very shortly.
Chapter 1: What is Node.js
Node.js is a JavaScript runtime, which means it runs programs written in JavaScript. Most developers use it to create command-line tools or web server applications.

Skip Ahead?

That’s everything you need know about Node.js. If you’re eager to start programming, skip ahead to Chapter 2. That said, it’s worth revisiting this chapter later to learn about Node’s advantages and core features.

JavaScript, JScript, ECMAScript, ES6, ES2015?

To make learning more confusing for beginners, JavaScript has many names. It started life as “Live Script” in 1994. Netscape rebranded it as “JavaScript” following a hasty deal with Sun Microsystems, despite it bearing little resemblance to Java or lightweight scripting. Microsoft couldn’t use that name, so it became JScript in Internet Explorer.
In 2005, Mozilla (which grew out of Netscape) joined ECMA International and standardized the language as “ ECMAScript ”. Versions 1 to 3 documented the evolution of JavaScript up until 1999. Version 4 was abandoned, but ECMAScript 5 became the standard supported by most browsers in 2009.
Work then started on ECMAScript 6—or “ES6”. The final specification was approved in 2015, which led to yet another name: “ES2015”. New specifications now arrive every year.
Rightly or wrongly, this course refers to “JavaScript” throughout. References to specific versions (such as ES9/ES2018) are only made if they affect the version of Node.js you need to use.
Node.js was initially developed by Ryan Dahl. He took the V8 JavaScript engine from Google’s Chrome browser, added some APIs, wrapped it in an event loop, and launched it as an open-source product on Linux and macOS in 2009. The Windows edition arrived in 2011.
The Node Package Manager (npm) was introduced in 2010. It allowed developers to use code modules published by others in their own projects. There was no official ECMAScript module standard at the time, so Node.js and npm adopted CommonJS.
The first (non-beta) release of Node.js arrived in 2015, with updates promised every six months.
Node.js wasn’t the first JavaScript runtime, but unlike other options—such as Rhino and SpiderMonkey —its popularity grew exponentially. Even those writing PHP, Python, Ruby or other languages often use Node.js tools to supplement their development processes.
Why Learn Node.js?
JavaScript is the most-used language on GitHub , and it’s ranked highly by developers . Companies including Netflix, Uber, Trello, PayPal, LinkedIn, eBay, NASA and Medium have adopted Node.js, and most professional developers will have encountered Node.js tools.
Below, we’ll look at some of the reasons you should consider using Node.js.
It’s JavaScript
JavaScript is used on trillions of web pages, where it has a browser monopoly. Every professional web developer requires JavaScript knowledge to program client-side applications.
Server-side languages are more diverse. Historically, developers could opt for PHP, Ruby, Python, C# (ASP.NET), Perl, or Java, but these have different syntaxes and concepts. It can be difficult to switch contexts, so larger project teams often split into frontend and backend developers.
Node.js allows a developer with frontend JavaScript knowledge to leverage their skills on the backen

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents