
Your First Week With Node.js
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
While there have been quite a few attempts to get JavaScript working as a server-side language, Node.js (frequently just called Node) has been the first environment that's gained any traction. It's now used by companies such as Netflix, Uber and Paypal to power their web apps. Node allows for blazingly fast performance; thanks to its event loop model, common tasks like network connection and database I/O can be executed very quickly indeed.
From a beginner's point of view, one of Node's obvious advantages is that it uses JavaScript, a ubiquitous language that many developers are comfortable with. If you can write JavaScript for the client-side, writing server-side applications with Node should not be too much of a stretch for you.
In this book, we'll offer a beginner's introduction to Node and its related technologies, and get you under way writing your first Node applications.
It contains:
- What Is Node and When Should I Use It? by James Hibbard
- A Beginner Splurge in Node.js by Camilo Reyes and Michiel Mulders
- A Beginner's Guide to npm- the Node Package Manager by Michael Wanyoike and Peter Dierx
- Forms, File Uploads and Security with Node.js and Express by Mark Brown
- MEAN Stack: Build an App with Angular 2+ and the Angular CLI by Manjunath M
- Debugging JavaScript with the Node Debugger by Camilo Reyes
- Using MySQL with Node.js and the mysql JavaScript Client by Jay Raj
- How to Use SSL/TLS with Node.js by Florian Rappl and Almir Bijedic
This book is for anyone who wants to start learning server-side development with Node.js. Familiarity with JavaScript is assumed, but we don't assume any previous back-end development experience.
More details
Other editions
New editions

Person
I'm a web developer currently living in the sunny north of Germany. I enjoy coding in both JavaScript and Ruby and can often be found in SitePoint's JavaScript forum. When I'm not coding, I enjoy running.
Content
- Your First Week With Node.js
- Notice of Rights
- Notice of Liability
- Trademark Notice
- About SitePoint
- Preface
- Who Should Read This Book?
- Conventions Used
- Code Samples
- Tips, Notes, and Warnings
- Chapter 1: What Is Node and When Should I Use It?
- by James Hibbard
- Node or Node.js?
- What Is Node.js?
- Node Is Built on Google Chrome's V8 JavaScript Engine
- How Do I Install Node.js?
- Node Binaries vs Version Manager
- Hello, World!" the Node.js Way
- Node.js Has Excellent ES6 Support
- Introducing npm, the JavaScript Package Manager
- Installing a Package Globally
- Installing a Package Locally
- Working With the package.json File
- What Is Node.js Used For?
- Node.js Lets Us Run JavaScript on the Server
- The Node.js Execution model
- Are There Any Downsides?
- Hello, World!" - Server Version
- What Kind of Apps Is Node.js Suited To?
- What Are the Advantages of Node.js?
- Other Uses of Node
- Conclusion
- Chapter 2: A Beginner Splurge in Node.js
- by Camilo Reyes & Michiel Mulders
- Why Node.js?
- Callbacks
- Asynchronous Operations
- File I/O
- A Web Server
- Async Await
- Conclusion
- Chapter 3: A Beginner's Guide to npm - the Node Package Manager
- by Michael Wanyoike & Peter Dierx
- Installing Node.js
- Using a Version manager for Installation
- Node Packaged Modules
- Changing the Location of Global Packages
- Installing Packages in Global Mode
- Listing Global Packages
- Installing Packages in Local Mode
- A Quicker Way
- A Lockfile?
- Managing Dependencies with package.json
- Uninstalling Local Packages
- Installing a Specific Version of a Package
- Updating a Package
- Underscore has to be listed as a dependency in package.json
- Searching for Packages
- Re-installing Project Dependencies
- Managing the Cache
- Aliases
- Version Managers
- Conclusion
- Chapter 4: Forms, File Uploads and Security with Node.js and Express
- by Mark Brown
- Setup
- Displaying the Form
- Form Submission
- Validation and Sanitization
- Validation
- Sanitization
- The Valid Form
- Security considerations
- TLS over HTTPS
- Wear Your Helmet
- Cross-site Request Forgery (CSRF)
- Cross-site Scripting (XSS)
- File Uploads
- Populating File Inputs
- Thanks For Reading
- Chapter 5: MEAN Stack: Build an App with Angular 2+ and the Angular CLI
- by Manjunath M
- Introduction to the MEAN Stack
- Overview
- Prerequisites
- Creating the Backend Using Express.js and MongoDB
- Initializing npm
- Filling in app.js
- Setting up mongoose
- Working on the controller and the model
- Mongoose Assigns _id Fields by Default
- Building the Front End Using Angular
- Creating Components, a Model, and a Service
- View-List Component
- Add-List Component
- Finishing Touches
- Wrapping It Up
- Chapter 6: Debugging JavaScript with the Node Debugger
- by Camilo Reyes
- The Node CLI Debugger
- Don't Mind the Entry Point
- Time for a Demo of Ducks
- Client-Side Debugging
- A List of Ducks
- How Is This Debuggable Through Node?
- Debugging inside an Editor
- Debugging Transpiled JavaScript
- Conclusion
- Chapter 7: Using MySQL with Node.js and the mysql JavaScript Client
- by Jay Raj
- Quick Start: How to Use MySQL in Node
- Installing the mysql Module
- Getting Started
- Connecting to the Database
- Using Grunt to Watch the Files for Changes
- Executing Queries
- Reading
- Creating
- Updating
- Destroying
- Advanced Use
- Stored Procedures
- Escaping User Input
- Why Not Just USE an ORM?
- Conclusion
- Chapter 8: How to Use SSL/TLS with Node.js
- by Florian Rappl & Almir Bijedic
- HTTPS Everywhere
- Basic Communication
- HTTPS
- Generating Certificates
- Certbot
- Webroot
- Tighetning It Up
- HSTS
- Diffie-Hellman Strong(er) Parameters
- Conclusion
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.