舉報

會員
Mastering Node.js(Second Edition)
Sandro Pasquali Kevin Faaborg 著
更新時間:2021-07-02 19:29:38
開會員,本書免費讀 >
最新章節:
Links and resources
ThisbookistargetedatJavaScriptdeveloperswhowanttotakeanin-depthlookatthelatestNode.jsframeworktocreatefaster,scalable,real-timebackendapplications.BasicJavaScriptprogrammingknowledge—andalsosomepreviousNode.jsdevelopmentexperience—aremandatorytogetthebestoutofthisbook
- Links and resources 更新時間:2021-07-02 19:29:38
- Closing thoughts
- Asynchronous add-ons
- Hello nan
- Using NAN
- A calculator
- Hello World
- Creating Your Own C++ Add-ons
- Lockfiles
- Other repositories
- Global installs and binaries
- Publishing and managing NPM packages
- Registering package dependencies
- npm as a build system using custom scripts
- Adding scripts to package.json
- Easy init
- Creating a package file
- How Node handles module paths
- Modules and caching
- Modules exports and module.exports
- The module object
- How to load and use modules
- Organizing Your Work into Modules
- Summary
- Live debugging
- CPU profiling
- Connecting Node to Chrome DevTools
- Dumping the heap
- Profiling processes
- Testing processes memory and CPU
- Testing the terrain
- Puppeteer
- Nightmare
- Headless testing with Nightmare and Puppeteer
- Mocks
- Stubs
- Spies
- Sinon
- Chai
- Mocha
- Testing with Mocha Chai and Sinon
- Using compiled contexts
- Distinguishing between local scope and execution context
- Sandboxing
- The assert module
- The Node debugger
- The util.inspect(object [options]) method
- The util.format(format [arg arg…]) method
- Formatting console output
- Writing to the console
- Native Node testing and debugging tools
- Integration tests
- Functional tests
- Unit tests
- Why testing is important
- Testing Your Application
- Summary
- Declaring Pod deployments
- Creating a basic Kubernetes cluster
- Orchestrating Containers with Kubernetes
- Running containers
- Creating a Dockerfile
- Getting started with Docker
- Containerized microservices
- Installing claudia and deploying a service
- Scaling with Claudia and API Gateway
- AWS Lambda
- Serverless applications
- Microservices with Seneca
- Deploying microservices
- 4-Tiers and microservices
- Service-Oriented Architectures
- How did this architecture come about?
- From monoliths to 3-Tiered architectures
- Monoliths
- From 3-Tiers to 4-Tiers
- Why microservices?
- Microservices
- Summary
- The ThankYou interface
- The switchboard
- Using Twilio webhooks to receive and send SMS messages
- Using Twilio to create an SMS bot on Heroku
- Sending mail via SES
- Searching the database
- Getting and setting data with DynamoDB
- Using AWS with a Node server
- Working with objects
- Working with buckets
- Using S3 to store files
- Errors
- Authenticating
- Using Amazon Web Services in your application
- UDP multicasting with Node
- Using Node's UDP module
- Types of exchanges
- Message queues – RabbitMQ
- Installing and configuring NGINX
- Deploying a NGINX load balancer on Digital Ocean
- Using the http-proxy module
- Forward and reverse proxies
- Running multiple Node servers
- Tools for monitoring servers
- Data creep
- Many file descriptors
- Socket usage
- Hot CPUs
- Network latency
- When to scale?
- Scaling Your Application
- Summary
- Real-time activity updates of multiple worker results
- Process files
- Monitoring
- Using PM2 to manage multiple processes
- Worker events
- Worker object properties
- Cluster events
- Using the cluster module
- Parsing a file using multiple processes
- Sending messages to children
- Communicating with your child
- Buffering process output
- Forking processes
- Spawning processes
- Creating child processes
- Multithreading is already native and transparent
- The benefits of single-threaded programming
- Node's single-threaded model
- Using Multiple Processes
- Summary
- Building a collaborative document editing application
- Asking questions and getting answers
- The EventSource stream protocol
- Using the EventSource API
- Listening for Server Sent Events
- Drawing collaboratively
- socket.io
- Using the WebSocket API
- Bidirectional communication with socket.io
- Creating a stock ticker
- Responding to calls
- Introducing AJAX
- Creating Real-Time Applications
- Further reading
- Summary
- Using JSON Web Tokens for authentication
- Handshaking
- Basic authentication
- Authenticating connections
- A simple poll
- Cookies and client state
- Handling sessions
- Storing user data
- Using Redis for tracking client state
- Using Express to route requests
- Understanding routes
- Routing requests
- Concurrency is not parallelism
- Understanding concurrency
- Managing Many Simultaneous Client Connections
- Summary
- Vue.js
- The renderer process
- Electron processes
- Electron
- A simple file browser
- Putting it all together
- Handling file uploads
- Implementing resource caching
- Content-Location
- Location
- Redirecting requests
- Serving static files
- Caveats
- fs.createWriteStream(path [options])
- Creating a writable stream
- fs.appendFile(path data [options] callback)
- fs.writeFile(path data [options] callback)
- Writing large chunks of data
- fs.write(fd buffer offset length position callback)
- Writing byte by byte
- Writing to a file
- The Readline module
- Reading a file line by line
- fs.createReadStream(path [options])
- Creating a readable stream
- fs.readFile(path [options] callback)
- Fetching an entire file at once
- fs.read(fd buffer offset length position callback)
- Reading byte by byte
- Reading from a file
- Moving through directories
- Synchronicity
- fs.fsync(fd callback)
- fs.exists(path callback)
- fs.mkdir(path [mode] callback)
- fs.rmdir(path callback)
- fs.unlink(path callback)
- fs.realpath(path [cache] callback)
- fs.readlink(path callback)
- fs.symlink(srcPath dstPath [type] callback)
- fs.link(srcPath dstPath callback)
- fs.lchmod(path mode callback)
- fs.fchmod(fd mode callback) ----
- fs.chmod(path mode callback)
- fs.lchown(path uid gid callback)
- fs.fchown(fd uid gid callback)
- fs.chown(path uid gid callback)
- fs.ftruncate(fd len callback)
- fs.truncate(path len callback)
- fs.rename(oldName newName callback)
- File operations
- fs.close(fd callback)
- fs.open(path flags [mode] callback)
- Opening and closing files
- File attributes
- File paths
- Types of files
- Directories and iterating over files and folders
- Using Node to Access the Filesystem
- Summary
- Creating caching and sending a PNG representation
- Creating and streaming images with Node
- Handling POST data
- Handling favicon requests
- Understanding content types
- Using cookies
- Working with headers
- The Querystring module
- The URL module
- The request object
- Installing a real SSL certificate
- Creating a self-signed certificate for development
- HTTPS TLS (SSL) and securing your server
- Proxying and tunneling
- Making HTTP requests
- Creating an HTTP server
- Using PassThrough streams
- Transforming streams
- Duplex streams
- Writable streams
- Pushing and pulling
- Implementing readable streams
- Exploring streams
- Why use streams?
- Streaming Data Across Nodes and Clients
- Summary
- Building a Twitter feed using file events
- Considerations
- Errors and exceptions
- Generators and Iterators
- async/await
- Promises
- Callbacks
- Managing concurrency
- Concurrency and errors
- unref and ref
- setInterval
- setTimeout
- Timers
- setImmediate
- process.nextTick
- Deferred execution
- File events
- Child processes
- Signals
- Listening for events
- Event loop ordering phases and priorities
- Understanding the event loop
- Queueing
- Collaboration
- Node's unique design
- Understanding Asynchronous Event-Driven Programming
- Summary
- The REPL
- The process object
- String manipulation
- Arrow functions
- Help with variables
- Optimized JavaScript
- Functions
- Objects and arrays
- Numbers and tracing optimization/de-optimization
- Optimizing your code
- Flags
- V8 JavaScript and optimizations
- The network
- Modularity
- Events
- Extending JavaScript
- Standard libraries
- Events for everything
- POSIX
- The Unix design philosophy
- Introduction – JavaScript as a systems language
- Understanding the Node Environment
- Questions
- Piracy
- Errata
- Downloading the example code
- Customer support
- Reader feedback
- Conventions
- Who this book is for
- What you need for this book
- What this book covers
- Preface
- Customer Feedback
- Why subscribe?
- www.PacktPub.com
- About the Reviewer
- About the Authors
- Credits
- 版權信息
- 封面
- 封面
- 版權信息
- 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
- Summary
- 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
- Summary
- 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
- Summary
- 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
- Summary
- Further reading
- 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
- Summary
- 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
- Summary
- 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
- Summary
- 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
- Summary
- 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
- Summary
- 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
- Creating Your Own C++ Add-ons
- Hello World
- A calculator
- Using NAN
- Hello nan
- Asynchronous add-ons
- Closing thoughts
- Links and resources 更新時間:2021-07-02 19:29:38