Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Advanced Node.js Development
Advanced Node.js Development

Advanced Node.js Development: Master Node.js by building real-world applications

eBook
$9.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Advanced Node.js Development

Getting Set Up

In this chapter, you'll get your local environment set up for the rest of the book. Whether you're on macOS, Linux, or Windows, we'll install MongoDB and Robomongo.

More specifically, we'll cover the following topics:

  • MongoDB and Robomongo installation for Linux and macOS
  • MongoDB and Robomongo installation for Windows

Installing MongoDB and Robomongo for Linux and macOS

This section is for macOS and Linux users. If you are on Windows, I have written a separate section for you.

The first thing we'll do is to download and set up MongoDB, as this will be the database we will use. We'll be using a third-party service to host our database when we eventually deploy it to Heroku, but on our local machine we'll need to download MongoDB so that we can start up a database server. This will let us connect to it via our Node applications to read and write data.

In order to grab the database, we'll head over to mongodb.com. Then we can go to the Download page and download the appropriate version.

On this page, scroll down and select Community Server; this is the one we'll be using. Also, there are options for different operating systems, whether it's Windows, Linux, macOS, or Solaris. I'm on macOS, so I'll use this download:

If you're on Linux, click on Linux; then go to the Version drop down and select the appropriate version. For example, if you're on Ubuntu 14.04, you can download the correct one from the Linux tab. Then, you can simply click on the Download button and follow along.

Next you can open it up. We'll just extract the directory, creating a brand new folder in the Downloads folder. If you're on Linux, you might need to manually extract the contents of that archive into the Downloads folder.

Now this folder contains a bin folder, and in there we have all of the executables that we need in order to do things such as connecting to the database and starting a database server:

Before we go ahead and run any of them. We'll rename this directory to mongo and then move it into the user directory. You can see that now in the user directory, I have the mongo folder. We'll also create a brand new directory alongside of mongo called mongo-data, and this will store the actual data inside of the database:

So when we insert a new record into the Todos table, for example, that will live in the mongo-data folder. Once you have the mongo folder moved into the user directory and you have the new mongo-data folder, you are ready to actually run the database server from Terminal. I'll go into Terminal and navigate into that brand new mongo folder that is in the user directory, where I currently am, so I can cd into mongo, then I'll cd into the bin directory by tacking it on right there:

cd mongo/bin

From here, we have a bunch of executables that we can run:

We have things such as bisondump and mongodump. In this section, we'll focus on: mongod, which will start up the database server, and mongo, which will let us connect to the server and run some commands. Just like when we type node we can run some JavaScript commands right in Terminal, when we type mongo, we'll be able to run some Mongo commands to insert, fetch, or do anything we like with the data.

First up though, let's start up the database server. I'll use ./ to run a file in the current directory. The file we'll run is called mongod; also, we do need to provide one argument: the dbpath argument. The dbpath argument will get set equal to the path of the directory we just created, the mongo-data directory. I'll use ~ (the tilde) to navigate to the user directory, and then to /mongo-data, as shown here:

./mongod --dbpath ~/mongo-data

Running this command will start up the server. This will create an active connection, which we can connect to for manipulating our data. The last line that you see when you run the command should be, waiting for connections on port 27017:

If you see this, it means that your server is up and running.

Next up, let's open a new tab, which starts in the exact same directory, and this time around, instead of running mongod, we'll run the mongo file:

./mongo

When we run mongo, we open up a console. It connects to the database server we just started, and from here, we can start running some commands. These commands are just to test that things are working as expected. We'll be going over all of this in detail later in this section. For now though, we can access db.Todos, and then we'll call .insert to create a brand new Todo record. I'll call it like a function:

db.Todos.insert({})

Next, inside of insert, we'll pass in our document. This will be the MongoDB document we want to create. For now, we'll keep things really simple. On our object, we'll specify one attribute, text, setting it equal to a string. Inside of quotes, type anything you want to do. I'll say Film new node course:

db.Todos.insert({text: 'Film new node course'})

With your command looking just like this, you can press enter, and you should get back a WriteResult object with an nInserted property, which is short for the number inserted: a value set to 1. This means that one new record was created, and that is fantastic!

Now that we've inserted a record, let's fetch the record just to make sure that everything worked as expected.

Instead of calling insert, we'll call find without any arguments. We want to return every single item in the Todos collection:

db.Todos.find()

When I run this, what do we get? We get one object-looking thing back:

We have our text attribute set to the text that we provided, and we have an _id property. This is the unique identifier for each record, which we'll talk about later. As long as you're seeing the text property coming back to what you set, you are good to go.

We can shut down the mongo command. However, we will still leave the mongod command running because there's one more thing I want to install. It's called Robomongo, and it's a graphic user interface for managing your Mongo database. This will be really useful as you start playing around with Mongo. You'll be able to view the exact data saved in the database; you can manipulate it and do all sorts of stuff.

Over in Finder, we have our mongo-data directory, and you can see that there is a ton of stuff in here. This means that our data was successfully saved. All of the data is in this mongo-data directory. To download and install Robomongo, which is available for Linux, Windows and macOS, we'll head over to robomongo.org and grab the installer for our operating system:

We can click on Download Robo 3T and download the most recent version; it should automatically detect your OS. Download the installer for either Linux or macOS. The one for macOS is really simple. It's one of those installers where you take the icon and drag it into the Applications folder. For Linux, you'll need to extract the archive and run the program in the bin directory. This will start up Robomongo on your Linux distribution.

Since I'm using macOS, I'll just quickly drag the icon over to Applications, and then we can play around with the program itself. Next, I'll open it up inside the Finder. When you first open up Robomongo, you might get a warning like the following on macOS, since it's a program that we downloaded and it's not from an identified macOS developer:

This is fine; most programs you download from the web will not be official since they did not come from the App Store. You can right-click on the downloaded package, select Open, and then click on Open again to run that program. When you first open it, you'll see some screens like the following:

We have a little screen in the background and a list of connections; currently that list is empty. What we need to do is to create a connection for our local MongoDB database so that we can connect to it and manipulate that data. We have Create. I'll click on this, and the only thing we'll need to update is Name. I'll give it a more descriptive name, such as Local Mongo Database. I'll set Address to localhost and the 27017 port is correct; there's no need to change these. So, I'll click on Save:

Next, I'll double-click on the database to connect to it. Inside the tiny window, we have our database. We are connected to it; we can do all sorts of things to manage it.

We can open up the test database, and in there, we should see one Collections folder. If we expand this folder, we have our Todos collection, and from there, we can right-click on the collection. Next, click on View Documents, and we should get our one Todo item, the one that we created over inside the Mongo console:

I can expand it to view the text property. Film new node course shows up:

If you're seeing this, then you are done.

The next section is for Windows users.

Installing MongoDB and Robomongo for Windows

If you're on Windows, this is the installation section for you. If you're on Linux or macOS, the previous section was for you; you can skip this one. Our goal here is to install MongoDB on our machines, which will let us create a local MongoDB database server. We'll be able to connect to that server with Node.js, and we'll be able to read and write data to the database. This will be fantastic for the Todo API, which will be responsible for reading and writing various Todo-related information.

To get started, we'll grab the MongoDB installer by going over to mongodb.com. Here we can click on the big green Download button; also, we can see several options on this page:

We'll use Community Server and for Windows. If you go to the Version drop down, none of the versions there will look right for you. The top one is what we want: Windows Server 08 R2 64-bit and later with SSL support. Let's start to download this. It is slightly big; just a tad over 100 MB, so it will take a moment for the download to begin.

I'll start it up. It's one of those basic installers, where you click on Next a few times and you agree to a license agreement. Click on the Custom option for a second, although we will be following through with the Complete option. When you click on Custom, it will show you where on your machine it's going to be installed, and this is important. Here, you can see that for me it's on C:\Program Files\MongoDB\Server, then in the 3.2 directory:

This is going to be important because we'll need to navigate into this directory in order to start up the MongoDB server. I will go back though, and I will be using the Complete option, which installs everything we need. Now we can actually start the installation process. Usually, you have to click on Yes, verifying that you want to install the software. I'll go ahead and do that, and then we are done.

Now once it's installed, we'll navigate into Command Prompt and boot up a server. The first thing we need to do is to navigate into that Program Files directory. I'm in Command Prompt. I recommend that you use Command Prompt and not Git Bash. Git Bash will not work for starting up the MongoDB server. I'll navigate to the root of my machine using cd/, and then we can start navigating to that path using the following command:

cd Program Files/MongoDB/Server/3.2

This is the directory where MongoDB was installed. I can use dir to print out the contents of this directory, and what we care about here is the bin directory:

We can navigate into bin using cd bin, and print its contents out using dir. Also, this directory contains a whole bunch of executables that we'll use to do things such as starting up our server and connecting to it:

The first executable we'll run is this mongod.exe file. This will start our local MongoDB database. Before we can go ahead and run this EXE, there is one more thing we need to do. Over in the generic File Explorer, we need to create a directory where all of our data can be stored. To do this, I'll put mine in my user directory by going to the C:/Users/Andrew directory. I'll make a new folder, and I'll call this folder mongo-data. Now, the mongo-data directory is where all of our data will actually be stored. This is the path that we need to specify when we run the mongod.exe command; we need to tell Mongo where to store the data.

Over in Command Prompt, we can now start this command. I'll run mongod.exe, passing in as the dbpath argument, the path to that folder we just created. In my case, it's /Users/Andrew/mongo-data. Now if your username is different, which it obviously is, or you put the folder in a different directory, you'll need to specify the absolute path to the mongo-data folder. Once you have that though, you can start up the server by running the following command:

mongod.exe --dbpath /Users/Andrew/mongo-data

You'll get a long list of output:

The only thing you need to care about is that, at the very bottom, you should see waiting for connections on port 27017. If you see this, then you are good to go. But now that the server is up, let's connect to it and issue some commands to create and read some data.

Creating and reading data

To do this, we'll open up a second Command Prompt window and navigate into that same bin directory using cd/Program Files/MongoDB/Server/3.2/bin. From here, we'll run mongo.exe. Note that we're not running the mongod command; we're running mongo.exe. This will connect to our local MongoDB database, and it will put us in sort of a Command Prompt view of our database. We'll be able to issue various Mongo commands to manipulate the data, kind of like we can run Node from Command Prompt to run various JavaScript statements right inside the console. When we run this, we're going to connect to the database. Over in the first console window, you can see that connection accepted shows up. We do have a new connection. In the first console window now, we can run some commands to create and read data. Now I don't expect you to take away anything from these commands. We'll not talk about the ins and outs of MongoDB just yet. All I want to do is to make sure that when you run them, it works as expected.

To get started, let's create a new Todo from the console. This can be done via db.Todos, and on this Todos collection, we'll call the .insert method. Also, we'll call insert with one argument, an object; this object can have any properties we want to add to the record. For example, I want to set a text property. This is the thing I actually need to do. Inside quotes, I can put something. I'll go with Create new Node course:

db.Todos.insert({text: 'Create new Node course'})

Now when I run this command, it will actually make the insert into our database and we should get a writeResult object back, with an nInserted property set to 1. This means that one record was inserted.

Now that we have one Todo in our database, we can try to fetch it using db.Todos once again. This time, instead of calling insert to add a record, we'll call find with no arguments provided. This will return every single Todo inside of our database:

db.Todos.find()

When I run this command, We get an object-looking thing where we have a text property set to Create new Node course. We also have an _id property. The _id property is MongoDB's unique identifier, and this is the property that they use to give your document; in this case, a Todo, a unique identifier. We'll be talking more about _id and about all of the commands we just ran, a little later. For now, we can close this using Ctrl + C. We've successfully disconnected from Mongo, and now we can also close the second Command Prompt window.

Before we move on, there is one more thing I want to do. We'll be installing a program called Robomongo—a GUI for MongoDB. It will let you connect to your local database as well as real databases, which we'll be talking about later. Also, it'll let you view all the data, manipulate it and do anything you could do inside a database GUI. It's really useful; sometimes you just need to dive into a database to see exactly what the data looks like.

In order to get this started, we'll head over to a new tab and go to robomongo.org:

Here we can grab the installer by going to Download. We'll download the latest version, and I'm on Windows. I want the installer, not the portable version, so I'll click on the first link here:

This is going to start a really small download, just 17 MB, and we can click on Next a few times through this one to get Robomongo installed on our machines.

I'll start the process, confirming installation and clicking on Next just a couple of times. There's no need to do anything custom inside the settings. We'll run the installer with all of the default settings applied. Now we can actually run the program by finishing all the steps in the installer. When you run Robomongo, you'll be greeted with a MongoDB Connections screen:

This screen lets you configure all of the connections for Robomongo. You might have a local connection for your local database, and you might have a connection to a real URL where your actual production data is stored. We'll get into all that later.

For now, we'll click on Create. By default, your localhost address and your 27017 port do not need to be changed:

All I'm going to do is to change the name so that it's a little easier to identify. I'll go with Local Mongo Database. Now, we can save our new connection and actually connect to the database by simply double-clicking on it. When we do that, we get a little tree view of our database. We have this test database; this is the one that's created by default, which we can expand. Then we can expand our Collections folder and see the Todos collection. This is the collection we created inside the console. I'll right-click on this and go to View Documents. When I view the documents, I actually get to view the individual records:

Here, I see my _id and text properties that have Create new Node course sitting in the above image.

If you are seeing this, then this means that you have a local Mongo server running, and it also means that you've successfully inserted data into it.

Summary

In this chapter, you downloaded and ran the MongoDB database server. This means that we have a local database server we can connect to from our Node application. We also installed Robomongo, which lets us connect to our local database so that we can view and manipulate data. This comes in handy when you're debugging or managing data, or doing anything else with your Mongo database. We'll be using it throughout the book, and you'll begin to see why it's valuable in the later chapters. For now though, you are all set up. You are ready to continue on and start building the Todo API.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Entirely project-based and practical
  • • Explains the "why" of Node.js features, not just the "how", providing with a deep understanding and enabling you to easily apply concepts in your own applications
  • • Covers the full range of technologies around Node.js – npm, MongoDB, version control with Git, and many more

Description

Advanced Node.js Development is a practical, project-based book that provides you with all you need to progress as a Node.js developer. Node is a ubiquitous technology on the modern web, and an essential part of any web developer’s toolkit. If you're looking to create real-world Node applications, or you want to switch careers or launch a side-project to generate some extra income, then you're in the right place. This book was written around a single goal: turning you into a professional Node developer capable of developing, testing, and deploying real-world production applications. There's no better time to dive in. According to the 2018 Stack Overflow Survey, Node is in the top ten for back-end popularity and back-end salary. This book is built from the ground up around the latest version of Node.js (version 9.x.x). You'll be learning all the cutting-edge features available only in the latest software versions. This book delivers advanced skills that you need to become a professional Node developer. Along this journey you'll create your own API, you'll build a full real-time web app and create projects that apply the latest Async and Await technologies. Andrew Mead maps everything out for you in this book so that you can learn how to build powerful Node.js projects in a comprehensive, easy-to-follow package designed to get you up and running quickly.

Who is this book for?

This book is for anyone looking to launch their own Node applications, switch careers, or freelance as a Node developer. You should have a basic understanding of JavaScript in order to follow this book. This book follows directly on from Learning Node.js Development, but more advanced readers can benefit from this book without having read the first part.

What you will learn

  • • Develop, test, and deploy real-world Node.js applications
  • • Master Node.js by building practical, working examples
  • • Use awesome third-party Node modules such as MongoDB, Mongoose, Socket.io, and Express
  • • Create real-time web applications
  • • Explore async and await in ES7
Estimated delivery fee Deliver to Taiwan

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 30, 2018
Length: 592 pages
Edition : 1st
Language : English
ISBN-13 : 9781788393935
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Taiwan

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Publication date : Mar 30, 2018
Length: 592 pages
Edition : 1st
Language : English
ISBN-13 : 9781788393935
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 125.97
Node.js Web Development
$48.99
RESTful Web API Design with Node.js 10, Third Edition
$32.99
Advanced Node.js Development
$43.99
Total $ 125.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Getting Set Up Chevron down icon Chevron up icon
MongoDB, Mongoose, and REST APIs – Part 1 Chevron down icon Chevron up icon
MongoDB, Mongoose, and REST APIs – Part 2 Chevron down icon Chevron up icon
MongoDB, Mongoose, and REST APIs – Part 3 Chevron down icon Chevron up icon
Real-Time Web Apps with Socket.io Chevron down icon Chevron up icon
Generating newMessage and newLocationMessage Chevron down icon Chevron up icon
Styling Our Chat Page as a Web App Chevron down icon Chevron up icon
The Join Page and Passing Room Data Chevron down icon Chevron up icon
ES7 classes Chevron down icon Chevron up icon
Async/Await Project Setup Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(6 Ratings)
5 star 33.3%
4 star 16.7%
3 star 16.7%
2 star 33.3%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Martin Richard Sanders Nov 05, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
He is putting me on promotion, because of this book.
Amazon Verified review Amazon
David Leonardo Galasso Sep 01, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Gratefull reading, I've enjoyed every page.Get the match if you are starting back-end from Javascript!Good book
Amazon Verified review Amazon
3xpl0it2c Oct 04, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Very good,but I think it is very basic...All I have learned is mongoose, async and socket.ioIt does teach well but I expected More.
Amazon Verified review Amazon
S. Olson Feb 18, 2019
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Why would I buy this title whent he publisher doesn't include a TOC? Tells a story that isn't very promising.
Amazon Verified review Amazon
Anastasios Apr 22, 2024
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
A lot of typos on the code. Needs to be updated. Also try on write the code inside a code bracket if its fully done or do piece by piece code not both, it makes it really confusing.
Subscriber review Packt
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela