JavaScript from Frontend to Backend - Eric Sarrion - E-Book

JavaScript from Frontend to Backend E-Book

Eric Sarrion

0,0
19,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

JavaScript, the most widely used programming language in the world, has numerous libraries and modules and a dizzying array of need-to-know topics. Picking a starting point can be difficult. Enter JavaScript from Frontend to Backend. This concise, practical guide will get you up to speed in next to no time.
This book begins with the basics of variables and objects in JavaScript and then moves quickly on to building components on the client-side with Vue.js and a simple list management application. After that, the focus shifts to the server-side and Node.js, where you’ll examine the MVC model and explore the Express module. Once you've got to grips with the server-side and the client-side, the only thing that remains is the database. You’ll discover MongoDB and the Mongoose module. In the final chapter of this fast-paced guide, you'll combine all these pieces to integrate a Vue.js application into a Node.js server, using Express to structure the server code and MongoDB to store the information.
By the end of this book, you will have the skills and confidence to successfully implement JavaScript concepts in your own projects and begin your career as a JavaScript developer.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 266

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



JavaScript from Frontend to Backend

Learn full stack JavaScript development using the MEVN stack with quick and easy steps

Eric Sarrion

BIRMINGHAM—MUMBAI

JavaScript from Frontend to Backend

Copyright © 2022 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 author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.

Associate Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Jane D’souza

Senior Editor: Mark D’souza

Content Development Editor: Debolina Acharyya

Technical Editor: Shubham Sharma

Copy Editor: Safis Editing

Proofreader: Safis Editing

Indexer: Rekha Nair

Production Designer: Vijay Kamble

Marketing Coordinater: Marylou De Mello, Anamika Singh

First published: August 2022

Production reference: 2090822

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80107-031-7

www.packt.com

Contributors

About the author

Eric Sarrion is a trainer, a developer, and an independent consultant. He has been involved in all kinds of IT projects for over 30 years. He is also a long-time author in web development technologies and is renowned for the clarity of his explanations and examples.

About the reviewer

Presently, Kailash Ramanathan works at Uber as a Senior Software Engineer. Since 2009, he has built several lean and powerful web-based applications using contemporary frameworks. Now, he enjoys working with Vue & React. When not at work, he enjoys music & a good-natured banter with friends and family.

First, I thank my parents for their incessant and unconditional support for every enterprise I undertake. Second, I thank God for this life & surrounding it with beautiful people I know - near and dear. Third, I thank my mentors & authors who I have read and learned from. And, to you who are reading these words and have chosen to know more and go beyond.

Gabriel Bieules is an engineer with 18 years of experience in building software applications. He worked in various industries like telecommunication, eDiscovery, and the web. He got exposed to multiple programming languages, but his expertise is mostly around Java and JavaScript.

Table of Contents

Preface

Part 1: JavaScript Syntax

Chapter 1: Exploring the Core Concepts of JavaScript

Technical requirements

Types of variables used in JavaScript

Numerical values

Boolean values

Character strings

Arrays

Objects

Running a JavaScript program

Running a JavaScript program in a browser

Running a JavaScript program on a Node.js server

Differences between JavaScript code written for the browser and the server

Declaring variables in JavaScript

Using the const keyword

Using the var keyword

Using the let keyword

What if we don’t use var or let to define a variable?

What is an uninitialized variable worth?

Writing conditions for conditional tests

Forms of writing instructions

Expressions used to write conditions

Nested test suites

Creating processing loops

Loops with while()

Loops with for()

Using functions

Function displaying the list of the first 10 integers

Function calculating the sum of the first 10 integers

Function calculating the sum of the first N integers

Summary

Chapter 2: Exploring the Advanced Concepts of JavaScript

Technical requirements

Classes and objects

Defining a class

Creating an object by using a class

Creating an object without using a class

Adding properties to a class

Adding methods to a class

Changing an object’s property values

Using the class constructor

Merging one object with another

Arrays

Creating an array

Accessing array elements

Adding items to the array

Deleting array elements

Filtering elements in an array

Character strings

Creating a character string

Accessing characters in a string

Modifying a character string

Using regular expressions

Multitasking in JavaScript

Using the setTimeout() function

Using the setInterval() function

Using the clearInterval() function

Using promises

Part 2: JavaScript on the Client-Side

Chapter 3: Getting Started with Vue.js

Technical requirements

Using Vue.js in an HTML page

Creating our first Vue.js application

Using reactivity

Creating our first component

Inserting a component in the application file

Inserting a component from an external file

Adding methods in components

Defining methods in the methods section

Defining computed properties in the computed section

Using attributes in components

Using directives

The v-if and v-else directives

The v-show directive

The v-for directive

The v-model directive

Summary

Chapter 4: Advanced Concepts of Vue.js

Technical requirements

Managing events

Using the $event parameter

Checking that the entered value is less than 100

Allowing only digits to be entered

Assembling components

Using $emit() to communicate with a parent component

Using props to communicate with children

Using visual effects

When the element appears

When the element disappears

Using a name for the effect

Producing an effect on several elements

Examples of commonly used effects

The shrink effect

The opacity effect

The move-down effect

Summary

Chapter 5: Managing a List with Vue.js

Technical requirements

Displaying application screens

Splitting the application into components

Adding an element to the list

Using the <Element> component

Changing the appearance of the list using CSS code

Removing an element from the list

Modifying an element in the list

Transforming the <span> element into an <input> element

Exiting from the input field

Giving focus to the input field

Summary

Part 3: JavaScript on the Server-Side

Chapter 6: Creating and Using Node.js Modules

Technical requirements

Creating and using our own modules

Creating a module

Using the node_modules directory

Using the package.json file

Adding functionalities to the module

Using internal Node.js modules

Reading the contents of a file

Displaying file contents as strings

Using non-blocking file reading

Using downloaded modules with npm

Using the npm command

Using a downloaded module with npm

Summary

Chapter 7: Using Express with Node.js

Technical requirements

Using the Node.js http module

Installing the Express module

The MVC pattern used by Express

Using routes with Express

The initial content of the app.js file

Different types of routes possible

Analyzing routes defined in the app.js file

Adding a new route in the app.js file

Displaying views with Express

Summary

Chapter 8: Using MongoDB with Node.js

Technical requirements

Installing MongoDB

Using the mongo utility

Installing the mongoose module

Connecting to the MongoDB database

Creating documents in MongoDB

Describing document structure using schemas and models

Creating the document

Searching for documents in MongoDB

Writing search conditions

Retrieving and displaying the results

Updating documents in MongoDB

Deleting documents in MongoDB

Summary

Chapter 9: Integrating Vue.js with Node.js

Technical requirements

Displaying application screens

Building the app with Express

MongoDB database structure

Installing the Axios library

Inserting a new element in the list

Replacing the text and index attributes with the element attribute

Description of the Axios library for communicating between the client and the server

Using Axios with a POST type request (client side)

POST type request processing (server side)

Verifying the correct operation of the insertion in the database

Displaying list elements

Using Axios with a GET type request (client side)

GET type request processing (server side)

Modifying an element in the list

Using Axios with a PUT type request (client side)

PUT type request processing (server side)

Removing an element from the list

Using Axios with a DELETE type request (client side)

DELETE type request processing (server side)

Summary

Thanks

Other Books You May Enjoy

Part 1: JavaScript Syntax

This part explains the basics you need to know to use JavaScript on the client or on the server. It explains the syntax and the main data types that can be used in JavaScript.

This section comprises the following chapters:

Chapter 1, Exploring the Core Concepts of JavaScriptChapter 2, Exploring the Advanced Concepts of JavaScript