To get the most out of this book
To get the most out of this book you can download the example code files and the color images as per the instructions below.
Download the example code files
You can download the example code files for this book from your account at www.packt.com/. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
- Log in or register at http://www.packt.com.
- Select the Support tab.
- Click on Code Downloads.
- Enter the name of the book in the Search box and follow the on-screen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR / 7-Zip for Windows
- Zipeg / iZip / UnRarX for macOS
- 7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at nodejsdp.link/repo. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781839214110_ColorImages.pdf.
Conventions used
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning:
- Code words in text:
server.listen(handle)
- Pathname:
src/app.js
- Dummy URL:
http://localhost:8080
A block of code is generally formatted using StandardJS conventions (nodejsdp.link/standard) and it is set as follows:
import zmq from 'zeromq'
async function main () {
const sink = new zmq.Pull()
await sink.bind('tcp://*:5017')
for await (const rawMessage of sink) {
console.log('Message from worker: ', rawMessage.toString())
}
}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are highlighted in bold:
const wss = new ws.Server({ server })
wss.on('connection', client => {
console.log('Client connected')
client.on('message', msg => {
console.log(`Message: ${msg}`)
redisPub.publish('chat_messages', msg)
})
})
Any command-line input or output is written as follows:
node replier.js
node requestor.js
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "To explain the problem, we will create a little web spider, a command-line application that takes in a web URL as the input and downloads its contents locally into a file."
Warnings or important notes appear like this.
Tips and tricks appear like this.
Most URLs are linked through our own short URL system to make it easier for readers coming through the print edition to access them. These links are in the form nodejsdp.link/some-descriptive-id.