更新时间:2021-07-02 19:29:38
封面
版权信息
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
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
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
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
Using Node to Access the Filesystem
Directories and iterating over files and folders
Types of files
File paths
File attributes