Node.js Notes for Professionals book

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

What people are saying about Notes for Professionals books Thanks, Great Collection. Binge downloaded plenty from your site - thanx a million!! Good Technical stuff for beginners and intermediates who is looking to learn any technology. Great collection of resources. I just download PDF from GoalKicker.com and i look documentation so good and simple. Great book! Thank you for sharing it. The Node.js Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified Book created for educational purposes and is not affiliated with Node.js group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners 334 pages, published on May 2018

Author(s): GoalKicker Books
Series: Programming Notes for Professionals
Publisher: GoalKicker Books
Year: 2018

Language: English
Pages: 334
Tags: Programming, Notes, Node.js, Professionals

Content list
About
Chapter 1: Getting started with Node.js
Section 1.1: Hello World HTTP server
Section 1.2: Hello World command line
Section 1.3: Hello World with Express
Section 1.4: Installing and Running Node.js
Section 1.5: Debugging Your NodeJS Application
Section 1.6: Hello World basic routing
Section 1.7: Hello World in the REPL
Section 1.8: Deploying your application online
Section 1.9: Core modules
Section 1.10: TLS Socket: server and client
Section 1.11: How to get a basic HTTPS web server up and running!
Chapter 2: npm
Section 2.1: Installing packages
Section 2.2: Uninstalling packages
Section 2.3: Setting up a package configuration
Section 2.4: Running scripts
Section 2.5: Basic semantic versioning
Section 2.6: Publishing a package
Section 2.7: Removing extraneous packages
Section 2.8: Listing currently installed packages
Section 2.9: Updating npm and packages
Section 2.10: Scopes and repositories
Section 2.11: Linking projects for faster debugging and development
Section 2.12: Locking modules to specific versions
Section 2.13: Setting up for globally installed packages
Chapter 3: Web Apps With Express
Section 3.1: Getting Started
Section 3.2: Basic routing
Section 3.3: Modular express application
Section 3.4: Using a Template Engine
Section 3.5: JSON API with ExpressJS
Section 3.6: Serving static files
Section 3.7: Adding Middleware
Section 3.8: Error Handling
Section 3.9: Getting info from the request
Section 3.10: Error handling in Express
Section 3.11: Hook: How to execute code before any req and after any res
Section 3.12: Setting cookies with cookie-parser
Section 3.13: Custom middleware in Express
Section 3.14: Named routes in Django-style
Section 3.15: Hello World
Section 3.16: Using middleware and the next callback
Section 3.17: Error handling
Section 3.18: Handling POST Requests
Chapter 4: Filesystem I/O
Section 4.1: Asynchronously Read from Files
Section 4.2: Listing Directory Contents with readdir or readdirSync
Section 4.3: Copying files by piping streams
Section 4.4: Reading from a file synchronously
Section 4.5: Check Permissions of a File or Directory
Section 4.6: Checking if a file or a directory exists
Section 4.7: Determining the line count of a text file
Section 4.8: Reading a file line by line
Section 4.9: Avoiding race conditions when creating or using an existing directory
Section 4.10: Cloning a file using streams
Section 4.11: Writing to a file using writeFile or writeFileSync
Section 4.12: Changing contents of a text file
Section 4.13: Deleting a file using unlink or unlinkSync
Section 4.14: Reading a file into a Buer using streams
Chapter 5: Exporting and Consuming Modules
Section 5.1: Creating a hello-world.js module
Section 5.2: Loading and using a module
Section 5.3: Folder as a module
Section 5.4: Every module injected only once
Section 5.5: Module loading from node_modules
Section 5.6: Building your own modules
Section 5.7: Invalidating the module cache
Chapter 6: Exporting and Importing Module in node.js
Section 6.1: Exporting with ES6 syntax
Section 6.2: Using a simple module in node.js
Chapter 7: How modules are loaded
Section 7.1: Global Mode
Section 7.2: Loading modules
Chapter 8: Cluster Module
Section 8.1: Hello World
Section 8.2: Cluster Example
Chapter 9: Readline
Section 9.1: Line-by-line file reading
Section 9.2: Prompting user input via CLI
Chapter 10: package.json
Section 10.1: Exploring package.json
Section 10.2: Scripts
Section 10.3: Basic project definition
Section 10.4: Dependencies
Section 10.5: Extended project definition
Chapter 11: Event Emitters
Section 11.1: Basics
Section 11.2: Get the names of the events that are subscribed to
Section 11.3: HTTP Analytics through an Event Emitter
Section 11.4: Get the number of listeners registered to listen for a specific event
Chapter 12: Autoreload on changes
Section 12.1: Autoreload on source code changes using nodemon
Section 12.2: Browsersync
Chapter 13: Environment
Section 13.1: Accessing environment variables
Section 13.2: process.argv command line arguments
Section 13.3: Loading environment properties from a "property file"
Section 13.4: Using dierent Properties/Configuration for dierent environments like dev, qa, staging etc
Chapter 14: Callback to Promise
Section 14.1: Promisifying a callback
Section 14.2: Manually promisifying a callback
Section 14.3: setTimeout promisified
Chapter 15: Executing files or commands with Child Processes
Section 15.1: Spawning a new process to execute a command
Section 15.2: Spawning a shell to execute a command
Section 15.3: Spawning a process to run an executable
Chapter 16: Exception handling
Section 16.1: Handling Exception In Node.Js
Section 16.2: Unhanded Exception Management
Section 16.3: Errors and Promises
Chapter 17: Keep a node application constantly running
Section 17.1: Use PM2 as a process manager
Section 17.2: Running and stopping a Forever daemon
Section 17.3: Continuous running with nohup
Chapter 18: Uninstalling Node.js
Section 18.1: Completely uninstall Node.js on Mac OSX
Section 18.2: Uninstall Node.js on Windows
Chapter 19: nvm - Node Version Manager
Section 19.1: Install NVM
Section 19.2: Check NVM version
Section 19.3: Installing an specific Node version
Section 19.4: Using an already installed node version
Section 19.5: Install nvm on Mac OSX
Section 19.6: Run any arbitrary command in a subshell with the desired version of node
Section 19.7: Setting alias for node version
Chapter 20: http
Section 20.1: http server
Section 20.2: http client
Chapter 21: Using Streams
Section 21.1: Read Data from TextFile with Streams
Section 21.2: Piping streams
Section 21.3: Creating your own readable/writable stream
Section 21.4: Why Streams?
Chapter 22: Deploying Node.js applications in production
Section 22.1: Setting NODE_ENV="production"
Section 22.2: Manage app with process manager
Section 22.3: Deployment using process manager
Section 22.4: Deployment using PM2
Section 22.5: Using dierent Properties/Configuration for dierent environments like dev, qa, staging etc
Section 22.6: Taking advantage of clusters
Chapter 23: Securing Node.js applications
Section 23.1: SSL/TLS in Node.js
Section 23.2: Preventing Cross Site Request Forgery (CSRF)
Section 23.3: Setting up an HTTPS server
Section 23.4: Using HTTPS
Section 23.5: Secure express.js 3 Application
Chapter 24: Mongoose Library
Section 24.1: Connect to MongoDB Using Mongoose
Section 24.2: Find Data in MongoDB Using Mongoose, Express.js Routes and $text Operator
Section 24.3: Save Data to MongoDB using Mongoose and Express.js Routes
Section 24.4: Find Data in MongoDB Using Mongoose and Express.js Routes
Section 24.5: Useful Mongoose functions
Section 24.6: Indexes in models
Section 24.7: find data in mongodb using promises
Chapter 25: async.js
Section 25.1: Parallel : multi-tasking
Section 25.2: async.each(To handle array of data eciently)
Section 25.3: Series : independent mono-tasking
Section 25.4: Waterfall : dependent mono-tasking
Section 25.5: async.times(To handle for loop in better way)
Section 25.6: async.series(To handle events one by one)
Chapter 26: File upload
Section 26.1: Single File Upload using multer
Section 26.2: Using formidable module
Chapter 27: Socket.io communication
Section 27.1: "Hello world!" with socket messages
Chapter 28: Mongodb integration
Section 28.1: Simple connect
Section 28.2: Simple connect, using promises
Section 28.3: Connect to MongoDB
Section 28.4: Insert a document
Section 28.5: Read a collection
Section 28.6: Update a document
Section 28.7: Delete a document
Section 28.8: Delete multiple documents
Chapter 29: Handling POST request in Node.js
Section 29.1: Sample node.js server that just handles POST requests
Chapter 30: Simple REST based CRUD API
Section 30.1: REST API for CRUD in Express 3+
Chapter 31: Template frameworks
Section 31.1: Nunjucks
Chapter 32: Node.js Architecture & Inner Workings
Section 32.1: Node.js - under the hood
Section 32.2: Node.js - in motion
Chapter 33: Debugging Node.js application
Section 33.1: Core node.js debugger and node inspector
Chapter 34: Node server without framework
Section 34.1: Framework-less node server
Section 34.2: Overcoming CORS Issues
Chapter 35: Node.JS with ES6
Section 35.1: Node ES6 Support and creating a project with Babel
Section 35.2: Use JS es6 on your NodeJS app
Chapter 36: Interacting with Console
Section 36.1: Logging
Chapter 37: Cassandra Integration
Section 37.1: Hello world
Chapter 38: Creating API's with Node.js
Section 38.1: GET api using Express
Section 38.2: POST api using Express
Chapter 39: Graceful Shutdown
Section 39.1: Graceful Shutdown - SIGTERM
Chapter 40: Using IISNode to host Node.js Web Apps in IIS
Section 40.1: Using an IIS Virtual Directory or Nested Application via
Section 40.2: Getting Started
Section 40.3: Basic Hello World Example using Express
Section 40.4: Using Socket.io with IISNode
Chapter 41: CLI
Section 41.1: Command Line Options
Chapter 42: NodeJS Frameworks
Section 42.1: Web Server Frameworks
Section 42.2: Command Line Interface Frameworks
Chapter 43: grunt
Section 43.1: Introduction To GruntJs
Section 43.2: Installing gruntplugins
Chapter 44: Using WebSocket's with Node.JS
Section 44.1: Installing WebSocket's
Section 44.2: Adding WebSocket's to your file's
Section 44.3: Using WebSocket's and WebSocket Server's
Section 44.4: A Simple WebSocket Server Example
Chapter 45: metalsmith
Section 45.1: Build a simple blog
{{ title }}
Chapter 46: Parsing command line arguments
Section 46.1: Passing action (verb) and values
Section 46.2: Passing boolean switches
Chapter 47: Client-server communication
Section 47.1: /w Express, jQuery and Jade
Chapter 48: Node.js Design Fundamental
Section 48.1: The Node.js philosophy
Chapter 49: Connect to Mongodb
Section 49.1: Simple example to Connect mongoDB from Node.JS
Section 49.2: Simple way to Connect mongoDB with core Node.JS
Chapter 50: Performance challenges
Section 50.1: Processing long running queries with Node
Chapter 51: Send Web Notification
Section 51.1: Send Web notification using GCM ( Google Cloud Messaging System)
Chapter 52: Remote Debugging in Node.JS
Section 52.1: Use the proxy for debugging via port on Linux
Section 52.2: NodeJS run configuration
Section 52.3: IntelliJ/Webstorm Configuration
Chapter 53: Database (MongoDB with Mongoose)
Section 53.1: Mongoose connection
Section 53.2: Model
Section 53.3: Insert data
Section 53.4: Read data
Chapter 54: Good coding style
Section 54.1: Basic program for signup
Chapter 55: Restful API Design: Best Practices
Section 55.1: Error Handling: GET all resources
Chapter 56: Deliver HTML or any other sort of file
Section 56.1: Deliver HTML at specified path
Chapter 57: TCP Sockets
Section 57.1: A simple TCP server
Section 57.2: A simple TCP client
Chapter 58: Hack
Section 58.1: Add new extensions to require()
Chapter 59: Bluebird Promises
Section 59.1: Converting nodeback library to Promises
Section 59.2: Functional Promises
Section 59.3: Coroutines (Generators)
Section 59.4: Automatic Resource Disposal (Promise.using)
Section 59.5: Executing in series
Chapter 60: Async/Await
Section 60.1: Comparison between Promises and Async/Await
Section 60.2: Async Functions with Try-Catch Error Handling
Section 60.3: Stops execution at await
Section 60.4: Progression from Callbacks
Chapter 61: Koa Framework v2
Section 61.1: Hello World example
Section 61.2: Handling errors using middleware
Chapter 62: Unit testing frameworks
Section 62.1: Mocha Asynchronous (async/await)
Section 62.2: Mocha synchronous
Section 62.3: Mocha asynchronous (callback)
Chapter 63: ECMAScript 2015 (ES6) with Node.js
Section 63.1: const/let declarations
Section 63.2: Arrow functions
Section 63.3: Arrow Function Example
Section 63.4: destructuring
Section 63.5: flow
Section 63.6: ES6 Class
Chapter 64: Routing AJAX requests with Express.JS
Section 64.1: A simple implementation of AJAX
Chapter 65: Sending a file stream to client
Section 65.1: Using fs And pipe To Stream Static Files From The Server
Section 65.2: Streaming Using fluent-mpeg
Chapter 66: NodeJS with Redis
Section 66.1: Getting Started
Section 66.2: Storing Key-Value Pairs
Section 66.3: Some more important operations supported by node_redis
Chapter 67: Using Browserfiy to resolve 'required' error with browsers
Section 67.1: Example - file.js
Chapter 68: Node.JS and MongoDB.
Section 68.1: Connecting To a Database
Section 68.2: Creating New Collection
Section 68.3: Inserting Documents
Section 68.4: Reading
Section 68.5: Updating
Section 68.6: Deleting
Chapter 69: Passport integration
Section 69.1: Local authentication
Section 69.2: Getting started
Section 69.3: Facebook authentication
Section 69.4: Simple Username-Password Authentication
Section 69.5: Google Passport authentication
Chapter 70: Dependency Injection
Section 70.1: Why Use Dependency Injection
Chapter 71: NodeJS Beginner Guide
Section 71.1: Hello World !
Chapter 72: Use Cases of Node.js
Section 72.1: HTTP server
Section 72.2: Console with command prompt
Chapter 73: Sequelize.js
Section 73.1: Defining Models
Section 73.2: Installation
Chapter 74: PostgreSQL integration
Section 74.1: Connect To PostgreSQL
Section 74.2: Query with Connection Object
Chapter 75: MySQL integration
Section 75.1: Connect to MySQL
Section 75.2: Using a connection pool
Section 75.3: Query a connection object with parameters
Section 75.4: Query a connection object without parameters
Section 75.5: Run a number of queries with a single connection from a pool
Section 75.6: Export Connection Pool
Section 75.7: Return the query when an error occurs
Chapter 76: MySQL Connection Pool
Section 76.1: Using a connection pool without database
Chapter 77: MSSQL Intergration
Section 77.1: Connecting with SQL via. mssql npm module
Chapter 78: Node.js with Oracle
Section 78.1: Connect to Oracle DB
Section 78.2: Using a local module for easier querying
Section 78.3: Query a connection object without parameters
Chapter 79: Synchronous vs Asynchronous programming in nodejs
Section 79.1: Using async
Chapter 80: Node.js Error Management
Section 80.1: try...catch block
Section 80.2: Creating Error object
Section 80.3: Throwing Error
Chapter 81: Node.js v6 New Features and Improvement
Section 81.1: Default Function Parameters
Section 81.2: Rest Parameters
Section 81.3: Arrow Functions
Section 81.4: "this" in Arrow Function
Section 81.5: Spread Operator
Chapter 82: Eventloop
Section 82.1: How the concept of event loop evolved
Chapter 83: Nodejs History
Section 83.1: Key events in each year
Chapter 84: passport.js
Section 84.1: Example of LocalStrategy in passport.js
Chapter 85: Asynchronous programming
Section 85.1: Callback functions
Section 85.2: Callback hell
Section 85.3: Native Promises
Section 85.4: Code example
Section 85.5: Async error handling
Chapter 86: Node.js code for STDIN and STDOUT without using any library
Section 86.1: Program
Chapter 87: MongoDB Integration for Node.js/Express.js
Section 87.1: Installing MongoDB
Section 87.2: Creating a Mongoose Model
Section 87.3: Querying your Mongo Database
Chapter 88: Lodash
Section 88.1: Filter a collection
Chapter 89: csv parser in node js
Section 89.1: Using FS to read in a CSV
Chapter 90: Loopback - REST Based connector
Section 90.1: Adding a web based connector
Chapter 91: Running node.js as a service
Section 91.1: Node.js as a systemd dæmon
Chapter 92: Node.js with CORS
Section 92.1: Enable CORS in express.js
Chapter 93: Getting started with Nodes profiling
Section 93.1: Profiling a simple node application
Chapter 94: Node.js Performance
Section 94.1: Enable gzip
Section 94.2: Event Loop
Section 94.3: Increase maxSockets
Chapter 95: Yarn Package Manager
Section 95.1: Creating a basic package
Section 95.2: Yarn Installation
Section 95.3: Install package with Yarn
Chapter 96: OAuth 2.0
Section 96.1: OAuth 2 with Redis Implementation - grant_type: password
Chapter 97: Node JS Localization
Section 97.1: using i18n module to maintains localization in node js app
Chapter 98: Deploying Node.js application without downtime.
Section 98.1: Deployment using PM2 without downtime
Chapter 99: Node.js (express.js) with angular.js Sample code
Section 99.1: Creating our project
Chapter 100: NodeJs Routing
Section 100.1: Express Web Server Routing
Chapter 101: Creating a Node.js Library that Supports Both Promises and Error-First Callbacks
Section 101.1: Example Module and Corresponding Program using Bluebird
Chapter 102: Project Structure
Section 102.1: A simple nodejs application with MVC and API
Chapter 103: Avoid callback hell
Section 103.1: Async module
Section 103.2: Async Module
Chapter 104: Arduino communication with nodeJs
Section 104.1: Node Js communication with Arduino via serialport
Chapter 105: N-API
Section 105.1: Hello to N-API
Chapter 106: Multithreading
Section 106.1: Cluster
Section 106.2: Child Process
Chapter 107: Windows authentication under node.js
Section 107.1: Using activedirectory
Chapter 108: Require()
Section 108.1: Beginning require() use with a function and file
Section 108.2: Beginning require() use with an NPM package
Chapter 109: Route-Controller-Service structure for ExpressJS
Section 109.1: Model-Routes-Controllers-Services Directory Structure
Section 109.2: Model-Routes-Controllers-Services Code Structure
Chapter 110: Push notifications
Section 110.1: Web notification
Section 110.2: Apple
Appendix A: Installing Node.js
Section A.1: Using Node Version Manager (nvm)
Section A.2: Installing Node.js on Mac using package manager
Section A.3: Installing Node.js on Windows
Section A.4: Install Node.js on Ubuntu
Section A.5: Installing Node.js with n
Section A.6: Install Node.js From Source with APT package manager
Section A.7: Install Node.js from source on Centos, RHEL and Fedora
Section A.8: Installing with Node Version Manager under Fish Shell with Oh My Fish!
Section A.9: Installing Node.js on Raspberry PI
Credits
You may also like