Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Web Development with MongoDB and Node.js
Web Development with MongoDB and Node.js

Web Development with MongoDB and Node.js: Build an interactive and full-featured web application from scratch using Node.js and MongoDB

eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.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

Web Development with MongoDB and Node.js

Chapter 1. Welcome to JavaScript in the Full Stack

What an exciting time to be a JavaScript developer! What was once only considered a language to add enhancements and widgets to a webpage has since evolved into its own full-fledged ecosystem. I believe Atwood's law says it best— any application that can be written in JavaScript, will eventually be written in JavaScript. While this quote dates back to 2007, it's never been more true than today. Not only can you use JavaScript to develop a complete single-page web application such as Gmail, but you will also see how we can achieve the following projects with JavaScript throughout the remaining part of the book:

  • How to completely power the backend using Node.js and Express.js
  • How to persist data with a powerful database like MongoDB
  • How to write dynamic HTML pages using Handlebars.js
  • How to deploy your entire project to the cloud using services like Heroku and AWS

With the introduction of Node.js, JavaScript has officially gone in a direction that was never even possible before. Now, you can use JavaScript on the server, and you can also use it to develop full-scale enterprise-level applications. When you combine this with the power of MongoDB and its JSON-powered data, you can work with JavaScript in every layer of your application.

One of the great advantages of developing with JavaScript in the "full stack" of a web application is that you are using a consistent language and syntax. Frameworks and libraries are no longer exclusive only to the frontend or backend but can be integrated into other layers of the application as well.

Underscore.js is an extremely popular JavaScript library to work with collections that is used equally on the backend with Node.js as much as on the frontend directly within the browser.

Welcome to JavaScript in the Full Stack

JavaScript in the full stack of a web application

Node.js changed JavaScript forever

Back in 2009, Ryan Dahl gave a presentation at JSConf that changed JavaScript forever. During his presentation, he introduced Node.js to the JavaScript community, and after a roughly 45-minute talk, he concluded it, receiving a standing ovation from the audience in the process. He was inspired to write Node.js after he saw a simple file upload progress bar on Flickr, the image-sharing site. Realizing that the site was going about the whole process the wrong way, he decided that there had to be a better solution.

As stated on the Node.js homepage, the goal of Node is to provide an easy way to build scalable network programs. It achieves this by providing an event-driven, nonblocking IO model that is extremely lightweight. Compared to traditional web-serving technologies that require a new CPU thread for every connection to the server that would eventually max out the systems resources, Node instead uses a single thread but doesn't block the I/O of the CPU. Thus, this allows Node to support tens of thousands of concurrent connections. It's for this very reason that Node is so popular with high-traffic web applications.

To see an example of just how lightweight Node can be, let's take a look at some sample code that starts up an HTTP server and sends Hello World to a browser:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(8080, 'localhost');
console.log('Server running at http://localhost:8080');

A few basic lines of code are all it takes to write a complete Node application. Running it with a simple node app.js command will launch an HTTP server that is listening on port 8080. Point any browser to http://localhost:8080, and you will see the simple output Hello World on your screen! While this sample app doesn't actually do anything useful, it should give you a glimpse of the kind of power you will have while writing web applications using Node.js.

At its core, Node is very low-level. It consists of a small set of modules that do very specific things and do them very well. These modules include tools to work with the file system, networking with TCP and HTTP, security, and streams.

Asynchronous callbacks

One of the most powerful features of Node is that it is event-driven and asynchronous. Code gets executed via callback functions whenever an event is broadcast. Simply put, you assign a callback function to an event, and when Node determines that the event has been fired, it will execute your callback function at that moment. No other code will get blocked waiting for an event to occur. Consider the following example to see asynchronous callbacks in action:

console.log('One');
console.log('Two');
setTimeout(function() {
    console.log('Three');
}, 2000);
console.log('Four');
console.log('Five');

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

In a typical synchronous programming language, executing the preceding code will yield the following output:

One
Two
... (2 second delay) ...
Three
Four
Five

However, in JavaScript and Node, the following output is seen:

One
Two
Four
Five
... (approx. 2 second delay) ...
Three

The function that actually logs Three is known as a callback to the setTimeout function.

Node Package Manager

Writing applications with Node is really enjoyable when you realize the sheer wealth of information and tools at your disposal! Using Node's built-in package manager npm, you can find literally tens of thousands of modules that can be installed and used within your application with just a few keystrokes! You can view the library of available modules by visiting http://npmjs.org. Downloading and installing any module within your application is as simple as executing the npm install package command. Have you written a module that you want to share with the world? Package it up using npm, and upload it to the public npmjs.org registry just as easily! Not sure how a module works that you downloaded and installed? The source code is right there in your projects' node_modules/ folder waiting to be explored!

Networking and file IO

In addition to the powerful nonblocking asynchronous nature of Node, it also has very robust networking and filesystem tools available via its core modules. With Node's networking modules, you can create server and client applications that accept network connections and communicate via streams and pipes.

Not just on the web

Node isn't just for web development! It can be a powerful solution to create command-line tools as well as full-featured locally run applications that have nothing to do with the Web or a browser. Grunt.js is a great example of a Node-powered command-line tool that many web developers use daily to automate everyday tasks such as build processes, compiling CoffeeScript, launching Node servers, running tests, and more.

In addition to command-line tools, Node has recently become increasingly popular among the hardware crowd with the Nodebots movement. Johnny-Five and Cylon.js are two popular Node libraries that exist to provide a framework to work with robotics.

Real-time web with Socket.io

Node achieves real-time communication with Socket.io. Using Socket.io, you can create features such as instant collaboration, which is similar to multiuser editing in Google Docs. What was once achieved using cumbersome (and not real-time) long polling can now be achieved using WebSockets. While WebSockets is a feature that is only supported in modern browsers, Socket.io also features seamless fallback implementations for legacy browsers.

Using this lightweight core, everything else is left to the developer—but don't let that scare you. The beauty of working with Node is that there is a thriving community developing and releasing modules every day via npm. As of this writing, npm has over 61,000 packages available! Throughout this book, we will use some of the most popular packages that help make writing web applications fun and easy!

The NoSQL movement

The term NoSQL has come to mean any kind of database that doesn't adhere to the strict structures of a typical relational database such as Microsoft SQL, MySQL, PostgreSQL, and so on. With a relational database, you are required to define ahead of time the exact structure of your schema. This means that you must have defined the exact number of columns, length, and datatype for every field in a table, and that each field must always match that exact set of criteria.

With a NoSQL database server such as MongoDB, records are stored as JSON-like documents. A typical document (record) in a MongoDB collection (table) might look like the following code:

$ mongo
> db.contacts.find({email: 'jason@kroltech.com'}).pretty()

{
    "email" : "jason@kroltech.com",
    "phone" : "123-456-7890",
    "gravatar" : "751e957d48e31841ff15d8fa0f1b0acf",
    "_id" : ObjectId("52fad824392f58ac2452c992"),
    "name" : {
        "first" : "Jason",
        "last" : "Krol"
    },
    "__v" : 0
}

One of the biggest advantages of using a NoSQL database server such as MongoDB is that it has a dynamic schema system, allowing records in a collection to be completely different from one another.

Some advantages of working with MongoDB are:

  • Dynamic schema design
  • Fast querying and indexing
  • Aggregate framework
  • Sharding and replication

In addition, as MongoDB was written using a JSON-like document structure, JavaScript becomes a powerful tool when working with queries and the interactive shell mongo. Like Node, MongoDB is also built for high performance, making it a great counterpart for building ever demanding, high traffic web and mobile applications. Depending on your exact needs, MongoDB may or may not be the right solution for your application. You should truly weigh the pros and cons of each technology before making a decision to determine which technology is right for you.

Node and MongoDB in the wild

Both Node and MongoDB are extremely popular and active in the development community. This is true for enterprises as well. Some of the biggest names in the Fortune 500 space have fully embraced Node to power their web applications. This is due in large part to the asynchronous nature of Node, which makes it a great alternative for high traffic, high IO applications such as e-commerce websites and mobile applications.

The following is just a small list of some big companies that are working with Node:

  • PayPal
  • LinkedIn
  • eBay
  • Walmart
  • Yahoo!
  • Microsoft
  • Dow Jones
  • Uber
  • New York Times

MongoDB's use in the enterprise sector is equally as impressive and wide reaching with an increasing number of companies adopting the leading NoSQL database server, such as:

  • Cisco
  • Craigslist Inc.
  • Forbes
  • FourSquare
  • Intuit
  • McAfee
  • MTV
  • MetLife
  • Shutterfly
  • Under Armour

What to expect from this book

The remainder of this book is going to be a guided tour that walks you through creating a complete data-driven website. The website we create will feature almost every aspect of a typical large-scale web development project. At its core, it will be powered by Node.js using a popular third-party framework called Express, and it will persist data using MongoDB.

In the first few chapters, we will cover the groundwork involved in getting the core of the server up and serving content. This includes configuring your environment so you are up and running with Node and MongoDB, and a basic introduction to the core concepts of both technologies. Then, we will write a web server from scratch powered by ExpressJS that will handle serving all of the necessary files for the website. From there, we will work with the Handlebars template engine to serve both static and dynamic HTML webpages. Diving deeper, we will make the application persistent by adding a data layer where the records for the website will be saved and retrieved via a MongoDB server. We will cover writing a RESTful API so that third parties can interact with your application. Finally, we will go into detail examining how to write and execute tests for all of your code.

Wrapping up, we will take a brief detour as we examine some popular, emerging frontend technologies that are becoming increasingly popular while writing single-page applications. These technologies include Backbone.js, Angular, and Ember.js.

Last but not least, we will go into details of how to deploy your new website to the Internet using popular cloud-based hosting services such as Heroku and Amazon Web Services.

Summary

In this chapter, we reviewed what is to be expected throughout the remainder of this book. We discussed the amazing current state of JavaScript and how it can be used to power the full stack of a web application. Not that you needed any convincing in the first place, but I hope you're excited and ready to get started writing web applications using Node.js and MongoDB!

Next up, we will set up your development environment and get you up and running with Node, MongoDB, and npm as well as write and launch a quick first Node app that uses MongoDB!

Left arrow icon Right arrow icon

Description

This book is designed for developers of any skill level that want to get up and running using Node.js and MongoDB to build full featured web applications. A basic understanding of JavaScript and HTML is the only requirement for this book.

What you will learn

  • Set up a development environment and install Node.js and MongoDB
  • Write and configure a web server using Node.js powered by the Express.js framework
  • Build dynamic HTML pages using the Handlebars template engine
  • Persist application data using MongoDB and Mongoose ODM
  • Create and consume RESTful APIs
  • Test your code using automated testing tools
  • Deploy to the cloud using services such as Heroku, Amazon Web Services, and Microsoft Azure
  • Explore Single Page Application frameworks to take your web applications to the next level
Estimated delivery fee Deliver to France

Premium delivery 7 - 10 business days

€10.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 25, 2014
Length: 294 pages
Edition : 1st
Language : English
ISBN-13 : 9781783987306
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 France

Premium delivery 7 - 10 business days

€10.95
(Includes tracking information)

Product Details

Publication date : Sep 25, 2014
Length: 294 pages
Edition : 1st
Language : English
ISBN-13 : 9781783987306
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 120.97
Web Development with MongoDB and Node.js
€36.99
Node.js Design Patterns
€41.99
MEAN Web Development
€41.99
Total 120.97 Stars icon

Table of Contents

13 Chapters
1. Welcome to JavaScript in the Full Stack Chevron down icon Chevron up icon
2. Getting Up and Running Chevron down icon Chevron up icon
3. Node and MongoDB Basics Chevron down icon Chevron up icon
4. Writing an Express.js Server Chevron down icon Chevron up icon
5. Dynamic HTML with Handlebars Chevron down icon Chevron up icon
6. Controllers and View Models Chevron down icon Chevron up icon
7. Persisting Data with MongoDB Chevron down icon Chevron up icon
8. Creating a RESTful API Chevron down icon Chevron up icon
9. Testing Your Code Chevron down icon Chevron up icon
10. Deploying with Cloud-based Services Chevron down icon Chevron up icon
11. Single Page Applications with Popular Frontend Frameworks Chevron down icon Chevron up icon
12. Popular Node.js Web Frameworks Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(12 Ratings)
5 star 58.3%
4 star 16.7%
3 star 0%
2 star 16.7%
1 star 8.3%
Filter icon Filter
Top Reviews

Filter reviews by




Burak AKIN Oct 14, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am not a professional coder or programmer. My job is health related. I code as a hobby. This book is what you need to get into development with Mongo and Nodejs. The example application inside the book will form a nice real time app also. The concepts are very well explained without boring you. Even a person like me can understand and code everything.
Amazon Verified review Amazon
Amazon Customer Oct 07, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a quick read to get you quickly running building any web applications with a MongoDB backend. The examples are easy to follow and quick to convert to a real scenario web application. Many extras beyond teaching the node and mongo lesson.
Amazon Verified review Amazon
Airam Oct 29, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Writing RESTful services in Nodejs can be as simple as glueing modules. Internet is plenty of Node.js middleware. To achieve so, you first need to learn the basics.It's better to have some previous knowledge of Javascript before reading this book as Web Development with MongoDB and Node.js has a tiny introduction to Javascript and Node.js.The book explains how to scaffold web applications through full coded examples. Middleware is the key of being highly productive and the book uses and explains the most well-known modules. You'll find out a big example split into several chapters that is a clone of a popular social image-sharing site that will show you things such as:Express: handle routing, middleware injection, ...Connect: a suite of middleware for multiple things. In the book Connect is used to deal with json, cookies, logging, parsing, encoding, HTTP method support, handling errors ...Handlebars: apart from explaining the basics of this template engine, it also shows how to build html layouts, partial views which prevent code duplication and helpers used for injecting functions at the time of rendering.And all this is wired up with MongoDB which is a NoSQL database. You'll learn the really basics of CRUD operations over Mongo (Create, Retrieve, Update and Delete). But Mongo is such simple that it really doesn't need further explanation other than seeing the API definition. This makes the book swift and faster to read. As it's already a tradition with Mongo and Javascript, it also involves Mongoose. Mongoose introduces schemas and models, that is to say built-in types, field restrictions and validation.The book culminates with four miscellaneous chapters. A chapter dedicated to testing using Behavior Driven Development (Mocha, Chai.js, Sinon.js, Proxyquire). Another chapter that gathers some web services (like Heroku, Amazon, Digital Ocean, Nodejitsu and Microsoft Azure) and tells how to deploy your nodejs web-apps. And finally, the last two chapters reviews front-end frameworks like: Backbone.js, Ember.js, Angular.js; and Node.js frameworks like Meteor, Sails, hapi, Koa or Flatiron.At the end of the book you will be more likely to start developing your own RESTful services as Node.js makes things simple and this book covers really common problems.You can get your copy of Web Development with MongoDB and Node.js right here!
Amazon Verified review Amazon
Steven Aug 09, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Jason is a MEAN expert! Great real world examples and spoken in a language that anyone can understand. Highly recommend this book to anyone who is spiking the Mongo/Express/Angular/Node stack to build engaging single page apps in JS.
Amazon Verified review Amazon
Sergiy Pylypets Oct 20, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book contains hands-on instructions for getting started with development of complete interactive Web sites using up-to-day Web technologies. It empowers readers with practical knowledge of Node.js and MongoDB. The first chapter describes new concepts of Web development, which were introduced with Node.js. From chapter 4, Writing an Express.js Server, we are guided to create a sample Web application, which includes all main functionality of real-world applications, based on the usage of Express.js Web framework. Chapter 9, Testing Your Code, introduces the tools and techniques to write automated tests for Node.js code. Chapter 10, Deploying with Cloud-based Services, provides detailed instructions for Cloud-based deployment and hosting of Web applications. In chapter 12, Popular Node.js Web Frameworks, author reviews other Web frameworks, including recently-emerged ones, and analyzes their advantages, drawbacks and cases of usage. The book is written by clear and concise language. The content includes a lot of code fragments, schemes, and screenshots. Each chapter ends with Summary section, which recapitulates all the main topics of the chapter. There are several reminder sections, like A JavaScript Primer, which recalls JavaScript basics, or What is an API, which discusses API development concepts. All chapters include links to additional information resources. For all main technologies being discussed, detailed step-by-step installation instructions are provided for Windows, Mac OS, and Linux environment, which greatly stimulate readers to download and try all the stuff. I think that this book can be useful for all Web developers, who want to use modern technologies for creating powerful and scalable Web applications.
Amazon Verified review Amazon
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