2 options
Mastering Node.js : build robust and scalable real-time server-side web applications efficiently / Sandro Pasquali, Kevin Faaborg.
- Format:
- Book
- Author/Creator:
- Pasquali, Sandro, author.
- Faaborg, Kevin, author.
- Language:
- English
- Subjects (All):
- Node.js.
- Application software--Development.
- Application software.
- JavaScript (Computer program language).
- Physical Description:
- 1 online resource (475 pages) : illustrations (some color)
- Edition:
- Second edition.
- Place of Publication:
- Birmingham, England : Packt, 2017.
- System Details:
- text file
- Biography/History:
- Pasquali Sandro: Sandro Pasquali formed a technology company named Simple in 1997, that sold the world's first JavaScript-based application development framework and was awarded several patents for deployment and advertising technologies that anticipated the future of Internet-based software. Node represents, for him, the natural next step in the inexorable march towards the day when JavaScript powers nearly every level of software development. Sandro has led the design of enterprise-grade applications for some of the largest companies in the world, including Nintendo, Major League Baseball, Bang and Olufsen, LimeWire, AppNexus, Conde Nast, and others. He has displayed interactive media exhibits during the Venice Biennial, won design awards, built knowledge management tools for research institutes and schools, and started and run several start-ups. Always seeking new ways to blend design excellence and technical innovation, he has made significant contributions across all levels of software architecture, from data management and storage tools to innovative user interfaces and frameworks. He is the author of Deploying Node. js, also by Packt Publishing, which aims to help developers get their work in front of others. Sandro runs a software development company in New York and trains corporate development teams interested in using Node and JavaScript to improve their products. He spends the rest of his time entertaining his beautiful daughter, and his wife. Faaborg Kevin: Kevin Faaborg is a professional software developer and avid software hobbyist. At Harvard, he learned C programming from visiting professor Brian Kernighan. He witnessed and contributed to how digital technology has shaped music distribution, working first at MTV Networks, then Lime Wire LLC, and now Spotify AB, where he designed and started the patent program. Kevin travels frequently, spending time each year in San Francisco, Colorado, NYC, and Stockholm. Follow him at github/zootella
- Summary:
- Expert techniques for building fast servers and scalable, real-time network applications with minimal effort; rewritten for Node.js 8 and Node.js 9 About This Book Packed with practical examples and explanations, Mastering Node.js contains everything you need to take your applications to the next level. Unleash the full potential of Node.js 9 to build real-time and scalable applications. Gain in-depth knowledge of asynchronous programming, event loops, and parallel data processing. Explore Node's innovative event-non-blocking design, and build professional applications with the help of detailed examples. Who This Book Is For This book is targeted at JavaScript developers who want to take an in-depth look at the latest Node.js framework to create faster, scalable, real-time backend applications. Basic JavaScript programming knowledge—and also some previous Node.js development experience—are mandatory to get the best out of this book What You Will Learn Build an Electron desktop app using Node that manages a filesystem Explore Streams and understand how they apply to building networked services Develop and deploy an SMS-driven customer service application Use WebSockets for rapid bi-directional communication Construct serverless applications with Amazon Lambda Test and debug with headless browsers, CPU profiling, Mocha, Sinon, and more Scale applications vertically and horizontally across multiple cores and web services In Detail Node.js, a modern development environment that enables developers to write server- and client-side code with JavaScript, thus becoming a popular choice among developers. This book covers the features of Node that are especially helpful to developers creating highly concurrent real-time applications. It takes you on a tour of Node's innovative event non-blocking design, showing you how to build professional applications. This edition has been updated to cover the latest features of Node 9 and ES6. All code examples and demo applications have been completely rewritten using the latest techniques, introducing Promises, functional programming, async/await, and other cutting-edge patterns for writing JavaScript code. Learn how to use microservices to simplify the design and composition of distributed systems. From building serverless cloud functions to native C++ plugins, from chatbots to massively scalable SMS-driven applications, you'll be prepared for building the next generation of distributed software. By the end of thi...
- Contents:
- Cover
- Copyright
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Understanding the Node Environment
- Introduction - JavaScript as a systems language
- The Unix design philosophy
- POSIX
- Events for everything
- Standard libraries
- Extending JavaScript
- Events
- Modularity
- The network
- V8, JavaScript, and optimizations
- Flags
- Optimizing your code
- Numbers and tracing optimization/de-optimization
- Objects and arrays
- Functions
- Optimized JavaScript
- Help with variables
- Arrow functions
- String manipulation
- The process object
- The REPL
- Summary
- Chapter 2: Understanding Asynchronous Event-Driven Programming
- Node's unique design
- Collaboration
- Queueing
- Understanding the event loop
- Event loop ordering, phases, and priorities
- Listening for events
- Signals
- Child processes
- File events
- Deferred execution
- process.nextTick
- setImmediate
- Timers
- setTimeout
- setInterval
- unref and ref
- Concurrency and errors
- Managing concurrency
- Callbacks
- Promises
- async/await
- Generators and Iterators
- Errors and exceptions
- Considerations
- Building a Twitter feed using file events
- Chapter 3: Streaming Data Across Nodes and Clients
- Why use streams?
- Exploring streams
- Implementing readable streams
- Pushing and pulling
- Writable streams
- Duplex streams
- Transforming streams
- Using PassThrough streams
- Creating an HTTP server
- Making HTTP requests
- Proxying and tunneling
- HTTPS, TLS (SSL), and securing your server
- Creating a self-signed certificate for development
- Installing a real SSL certificate
- The request object
- The URL module
- The Querystring module
- Working with headers
- Using cookies
- Understanding content types.
- Handling favicon requests
- Handling POST data
- Creating and streaming images with Node
- Creating, caching, and sending a PNG representation
- Chapter 4: Using Node to Access the Filesystem
- Directories, and iterating over files and folders
- Types of files
- File paths
- File attributes
- Opening and closing files
- fs.open(path, flags, [mode], callback)
- fs.close(fd, callback)
- File operations
- fs.rename(oldName, newName, callback)
- fs.truncate(path, len, callback)
- fs.ftruncate(fd, len, callback)
- fs.chown(path, uid, gid, callback)
- fs.fchown(fd, uid, gid, callback)
- fs.lchown(path, uid, gid, callback)
- fs.chmod(path, mode, callback)
- fs.fchmod(fd, mode, callback)
- fs.lchmod(path, mode, callback)
- fs.link(srcPath, dstPath, callback)
- fs.symlink(srcPath, dstPath, [type], callback)
- fs.readlink(path, callback)
- fs.realpath(path, [cache], callback)
- fs.unlink(path, callback)
- fs.rmdir(path, callback)
- fs.mkdir(path, [mode], callback)
- fs.exists(path, callback)
- fs.fsync(fd, callback)
- Synchronicity
- Moving through directories
- Reading from a file
- Reading byte by byte
- fs.read(fd, buffer, offset, length, position, callback)
- Fetching an entire file at once
- fs.readFile(path, [options], callback)
- Creating a readable stream
- fs.createReadStream(path, [options])
- Reading a file line by line
- The Readline module
- Writing to a file
- Writing byte by byte
- fs.write(fd, buffer, offset, length, position, callback)
- Writing large chunks of data
- fs.writeFile(path, data, [options], callback)
- fs.appendFile(path, data, [options], callback)
- Creating a writable stream
- fs.createWriteStream(path, [options])
- Caveats
- Serving static files
- Redirecting requests
- Location
- Content-Location
- Implementing resource caching
- Handling file uploads.
- Putting it all together
- A simple file browser
- Electron
- Electron processes
- The renderer process
- Vue.js
- Chapter 5: Managing Many Simultaneous Client Connections
- Understanding concurrency
- Concurrency is not parallelism
- Routing requests
- Understanding routes
- Using Express to route requests
- Using Redis for tracking client state
- Storing user data
- Handling sessions
- Cookies and client state
- A simple poll
- Authenticating connections
- Basic authentication
- Handshaking
- Using JSON Web Tokens for authentication
- Further reading
- Chapter 6: Creating Real-Time Applications
- Introducing AJAX
- Responding to calls
- Creating a stock ticker
- Bidirectional communication with socket.io
- Using the WebSocket API
- socket.io
- Drawing collaboratively
- Listening for Server Sent Events
- Using the EventSource API
- The EventSource stream protocol
- Asking questions and getting answers
- Building a collaborative document editing application
- Chapter 7: Using Multiple Processes
- Node's single-threaded model
- The benefits of single-threaded programming
- Multithreading is already native and transparent
- Creating child processes
- Spawning processes
- Forking processes
- Buffering process output
- Communicating with your child
- Sending messages to children
- Parsing a file using multiple processes
- Using the cluster module
- Cluster events
- Worker object properties
- Worker events
- Using PM2 to manage multiple processes
- Monitoring
- Process files
- Real-time activity updates of multiple worker results
- Chapter 8: Scaling Your Application
- When to scale?
- Network latency
- Hot CPUs
- Socket usage
- Many file descriptors
- Data creep
- Tools for monitoring servers
- Running multiple Node servers.
- Forward and reverse proxies
- Using the http-proxy module
- Deploying a NGINX load balancer on Digital Ocean
- Installing and configuring NGINX
- Message queues - RabbitMQ
- Types of exchanges
- Using Node's UDP module
- UDP multicasting with Node
- Using Amazon Web Services in your application
- Authenticating
- Errors
- Using S3 to store files
- Working with buckets
- Working with objects
- Using AWS with a Node server
- Getting and setting data with DynamoDB
- Searching the database
- Sending mail via SES
- Using Twilio to create an SMS bot on Heroku
- Using Twilio webhooks to receive and send SMS messages
- The switchboard
- The ThankYou interface
- Chapter 9: Microservices
- Why microservices?
- From 3-Tiers to 4-Tiers
- Monoliths
- From monoliths to 3-Tiered architectures
- How did this architecture come about?
- Service-Oriented Architectures
- 4-Tiers and microservices
- Deploying microservices
- Microservices with Seneca
- Serverless applications
- AWS Lambda
- Scaling with Claudia and API Gateway
- Installing claudia and deploying a service
- Containerized microservices
- Getting started with Docker
- Creating a Dockerfile
- Running containers
- Orchestrating Containers with Kubernetes
- Creating a basic Kubernetes cluster
- Declaring Pod deployments
- Chapter 10: Testing Your Application
- Why testing is important
- Unit tests
- Functional tests
- Integration tests
- Native Node testing and debugging tools
- Writing to the console
- Formatting console output
- The util.format(format, [arg, arg…]) method
- The util.inspect(object, [options]) method
- The Node debugger
- The assert module
- Sandboxing
- Distinguishing between local scope and execution context
- Using compiled contexts
- Testing with Mocha, Chai, and Sinon
- Mocha
- Chai
- Sinon
- Spies.
- Stubs
- Mocks
- Headless testing with Nightmare and Puppeteer
- Nightmare
- Puppeteer
- Testing the terrain
- Testing processes, memory, and CPU
- Profiling processes
- Dumping the heap
- Connecting Node to Chrome DevTools
- CPU profiling
- Live debugging
- Appendix A: Organizing Your Work into Modules
- How to load and use modules
- The module object
- Modules, exports, and module.exports
- Modules and caching
- How Node handles module paths
- Creating a package file
- Easy init
- Adding scripts to package.json
- npm as a build system using custom scripts
- Registering package dependencies
- Publishing and managing NPM packages
- Global installs and binaries
- Other repositories
- Lockfiles
- Appendix B: Creating Your Own C++ Add-ons
- Hello World
- A calculator
- Using NAN
- Hello, nan
- Asynchronous add-ons
- Closing thoughts
- Links and resources
- Index.
- Notes:
- Includes index.
- Includes bibliographical references.
- Description based on online resource; title from PDF title page (ebrary, viewed February 5, 2018).
- OCLC:
- 1020496941
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.