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
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Learning Yeoman
Learning Yeoman

Learning Yeoman: Design, implement, and deliver a successful modern web application project using three powerful tools in the Yeoman workflow.

Arrow left icon
Profile Icon Jonathan Spratley
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Aug 2014 288 pages 1st Edition
eBook
$29.69 $32.99
Paperback
$54.99
Arrow left icon
Profile Icon Jonathan Spratley
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Aug 2014 288 pages 1st Edition
eBook
$29.69 $32.99
Paperback
$54.99
eBook
$29.69 $32.99
Paperback
$54.99

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
Product feature icon AI Assistant (beta) to help accelerate your learning
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

Learning Yeoman

Chapter 1. Modern Workflows for Modern Webapps

This chapter will cover the three core tools that make up the Yeoman workflow, how to use these tools in development, and how to incorporate this workflow into new or existing projects.

In this chapter, you will learn the following topics:

  • The Yeoman tools and architecture
  • Downloading and installing Yeoman
  • Features of Yeoman
  • Using the Yeoman tools

An overview of Yeoman

The term modern webapps is a relatively new thing, as the Web is still in its infancy stage. As the Web matures, so does the need for developer tools and workflows, thanks to some modern-day Web pioneers over at Google. Paul Irish and Addy Osmani have developed a modern workflow that goes by the name of Yeoman.

The Yeoman workflow is a collection of three tools to improve developers' productivity when building web applications: Yo is the scaffolding tool, Grunt is the build tool, and Bower is the package tool.

  • Yo is used to scaffold things such as projects and files from templates
  • Grunt is used for task management, testing, code linting, and optimization
  • Bower is used for package management and to manage client-side dependencies

Yeoman's architecture

The Yeoman toolset runs in the Node.js environment and is invoked from the command line. Each tool is installed using Node's package manager (npm) and uses the npm repository to manage all plugins.

Node's package manager

Node.js is a platform that is built on Chrome's JavaScript runtime engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight, efficient, and perfect for real-time applications that run across distributed devices.

The official package manager for Node.js is npm. From Node versions 0.6.3 and up, npm is bundled and installed automatically with the environment. The npm package manager runs through the command line and manages the application dependencies that are available on the npm registry.

Note

The current Node.js version used in this book is v0.10.28.

Features of Yeoman

Before we dig deep into using each tool of the workflow, let's take a look at some of the Yeoman tooling features that will help you in your next project:

  • Quick install: Easily installs all three tools from the npm repository using one command
  • Scaffolding: Fast and easy-to-use command-line tool to create new projects or files from templates that individual generators provide
  • Build process: Tasks for concatenation, minification, optimization, and testing
  • Preview server: Connect LiveReload server to preview your application in the browser
  • Package management: Search, install, and manage project dependencies via the command line
  • Code linting: Scripts are run against JSHint to ensure language best practices
  • Automation: A simple watch task to compile CoffeeScript, LESS, or SASS, and reload the browser upon changes
  • Testing: Executes JavaScript code in multiple real browsers with the Karma runner
  • Optimization: Images are optimized using OptiPNG and JPEGtran, and HTML is optimized using the HTML minifier

The preceding features are dependent on what the individual generators provide via Grunt tasks. By default, the Angular, Backbone, Ember, and other webapp generators provide tasks to perform all the features listed.

Note

Grunt tasks are individual plugins that perform specific operations on files or folders.

Quick installation

Modern tools usually mean more tools to learn, but learning the tools of the Yeoman workflow is easier than you think. To demonstrate by example, here is how easy it is to get a modern web application up and running, all from the command line.

Installing Yeoman and friends

To install all three tools in the Yeoman workflow, just execute the following command in the terminal:

$ npm install -g yo

The command will install Yo, Grunt, and Bower into your systems path as follows:

  • The -g option flag specifies the installation to be globally available in your path, allowing the yo command to be invoked from anywhere
  • If using the latest versions of Node and Git, Yeoman will automatically install Bower and Grunt while installing Yo

Note

The -g flag installs globally and requires an administrator user.

If you run into any errors during the initial installation process, you can install the envcheck module to ensure that your system is ready for all of Yeoman's features; just execute the following command:

$ npm install -g envcheck

Installing a generator

To install generators for Yo, use npm. Let's install the generic webapp generator; open a terminal and execute the following command:

$ npm install -g generator-webapp

The preceding command will install the webapp generator globally on your system, easily letting you create new web projects within any directory of your choice.

Scaffolding with Yo

Yeoman includes a powerful command-line utility that can scaffold files based on individual generator templates, allowing you to save time creating files from scratch. There are over 700 community generators on npm.

  • To search for generators, add the generator- prefix before the name, as follows:
    $ npm search generator-[name]
    
  • To install generators, use npm install passing in the name of the package, as follows:
    $ npm install generator-[name]
    

Note

The npm attribute is the package manager for Node.js and comes bundled with it.

Creating the project

All Yeoman commands work off the current directory, so create a new folder named learning-ye oman-ch1, open the terminal, and cd to that location into the newly created directory.

Invoking the generator

Yo, the scaffold tool, will easily create and set up project configuration, files, and folders needed for a modern web application. Execute the following command:

$ yo webapp

Generators can be invoked with different options; in the preceding command, we use the generators' default options that include Mocha as the test framework and JavaScript as the scripting language. You will get an output similar to the following screenshot:

Invoking the generator

The preceding command does many things. First off, it's going to ask you a few questions about your new project, such as whether to include Twitter Bootstrap with or without Compass SASS and whether to include Modernizr.

Select the first option (Bootstrap), and press Enter; you will see the output to the terminal, and Yeoman is performing all the magic right before your eyes.

Directory structure

Do not be overwhelmed by the number of files generated; take a minute and examine the directory structure that Yeoman produces. You will notice how organized the directory structure is. It looks as follows:

├── Gruntfile.js
├── app
│   ├── 404.html
│   ├── bower_components
│   │   ├── bootstrap
│   │   └── jquery
│   ├── favicon.ico
│   ├── images
│   ├── index.html
│   ├── robots.txt
│   ├── scripts
│   │   └── main.js
│   └── styles
│       └── main.css
├── bower.json
├── node_modules
├── package.json
└── test
    ├── bower.json
    ├── bower_components
    ├── index.html
    └── spec

Just think of Yeoman as a helpful robot that does all the hard work for you, creating all the necessary files and folders to get started with development.

The build process

Yeoman includes Grunt, a task-based command-line tool for JavaScript projects. It is used to perform various build tasks on projects and exposes several useful tasks that you will want to use in your workflow. Yeoman automatically creates and configures Gruntfile.js, which specifies the configuration of the tasks and targets.

The following order of commands is used for a seamless development workflow:

$ yo webapp                   #scaffold application
$ bower install jquery        #install dependency
$ grunt serve                 #start preview server
$ grunt test                  #run unit tests
$ grunt                       #create optimized build

Generally, a modern web developer's workflow consists of the following steps:

  1. First, scaffold a new application using yo.
  2. Search and install third-party client-side libraries using bower.
  3. Start a preview server for development that allows you to write code, save it, and watch the results automatically become refreshed.
  4. Then run the test task that executes the tests located in the test directory.
  5. Then use the default grunt task to run the tests before creating an optimized build.

To view all the installed grunt tasks associated with the project, you can use the grunt –h command, which will output a list of all tasks and their descriptions.

The Connect LiveReload server

Now that you have all the initial files and folders for the project, you can really start to see the power of Yeoman.

Previewing the server

Connect LiveReload is the module that is a server that will auto reload when files are changed by the watch process.

To preview the application, execute the following command:

$ grunt serve

The serve task does a few things, which are as follows:

  1. First, it removes all the files in the .tmp directory via the clean task.
  2. It starts the Connect LiveReload server located at 127.0.0.1:9000, and opens the default web browser via the connect task.
  3. Then, finally, it runs the watch task that monitors the project's source (app/*) files, thus executing subtasks on changes.

Your default browser should have opened up, displaying the following page:

Previewing the server

Package management with Bower

Yeoman includes an excellent tool called Bower, which is a package manager for the Web and allows you to easily manage dependencies for your projects. Packages can include any type of assets such as JavaScript, images, and CSS. Twitter and the open source community actively maintain it.

Here are some of the available Bower commands:

  • search: This command will search for a dependency in the Bower registry
  • install: This command installs one or more dependencies
  • list: This command lists all the dependencies installed in the project
  • update: This command updates a dependency to the latest version

Let's go ahead and add a templating library to our webapp to handle the compilation of model data with HTML for the view. Open the terminal and execute the following command:

$ bower install handlebars --save

This command will download the Handlebars templating library and place the package in the app/bower_components directory.

To view all client-side dependencies associated with the project, just use the bower list command that will output a tree of all the installed components and their versions, and also inform us if updates are available, as shown in the following screenshot:

Package management with Bower

The preceding screenshot is the result of running the bower list command from within the project's root directory or the directory containing the bower.json file, which stores all the installed libraries.

The --save flag tells Bower to write the library name and version to the bower.json file located in the project's root directory. The bower.json file is how Bower manages the project's dependencies.

To wire up the newly downloaded package to the application's index.html page, execute the following grunt task:

$ grunt bowerInstall

This command will read the contents of the index.html file in the app folder. Then, look for the <!-- bower:js --> block and inject a script tag with the location of the component's main file for each package in the bower_components directory.

Code linting with JSHint

Yeoman includes JSHint, which is a linting tool that helps developers detect errors and potential problems in their JavaScript code; it is a great way to force best practices and improve the code quality. This is very useful when working with a large code base or in a team environment.

The jshint task is responsible for linting all code before it gets executed. The following screenshot shows an example of using the jshint task. It displays the errors that output when code fails the linking process:

Code linting with JSHint

Note

For more information on configuring JSHint, visit http://goo.gl/c2lsk1.

Let's begin to add some logic to the applications' main script file that was created during the initial scaffold. Open app/scripts/main.js and add the following:

/* global Handlebars */
(function () {
  'use strict';
  window.App = {
    init: function (config) {
      console.log( '1 - initialize' );
      this.config = config;
      if (this.config.feature && this.config.feature.endpoint) {
        this.fetch();
      }
      return this;
    },
    render: function () {
      console.log( '4 - render' );
      var template = Handlebars.compile( $( this.config.el ).find( 'script[type="text/x-handlebars-template"]' ).html() );
      var html = template( this.config );
      $( this.config.el ).html( html );
      return this;
    },
    onSuccess: function (response) {
      console.log( '3 - onSuccess' );
      this.config.features = response;
      this.render();
    },
    onError: function (error) {
      return this.log( error );
    },
    fetch: function () {
      console.log( '2 - fetch' );
      var self = this;
      $.ajax( {
        url: self.config.feature.endpoint,
        dataType: 'jsonp',
        success: function (results) {
          return self.onSuccess( results );
        },
        error: function (error) {
          return self.onError( error );
        }
      } );
    }
  };
})();

console.log( 'Allo, Allo!' );

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.

Here is the breakdown of the preceding code:

  1. First, we define Handlebars' global library to let JSHint know what we are doing.
  2. Then, we create a new App object on the JavaScript global window object.
  3. The render method takes the config.el property and renders the compiled template into the element.
  4. The init function takes a config object as the argument and will be set on the class as the config property.
  5. If the passed object has a feature.endpoint property, then the app will fetch features from that endpoint.
  6. The render method will compile the Handlebars template with the config object to create the HTML output, which is injected into config.el.
  7. The onSuccess method will set the model.features property to the results of the request and invoke the render method to display the contents.
  8. The onError method will log the error to the console.
  9. The fetch method will invoke a JSONP request to config.feature.endpoint.

Save the file, and the lint task will then compile into JavaScript and reload the browser; nothing will look different because we haven't added the application's template.

Automation

Yeoman comes with a watch task that is responsible for the automation of different tasks when developing web applications, such as compiling CoffeeScript to JavaScript when source files change or concatenating and parsing SASS files and then reloading the web browser to see changes.

The automation tasks are limited to the Grunt tasks that are defined by the generator; any changes to the .js or .html file in the app directory will automatically get parsed, and the browser will get refreshed. If the watch task detects changes to files in the test directory, then the unit tests are run via the test task.

Let's create the application's template; we will use the {{ }} double mustache syntax to render the dynamic content. Open the app/index.html file, and add the following contents inside the body element right below the browsehappy code line:

...  
<![endif]-->
  <div class="container">
    <script type="text/x-handlebars-template">
      <div class="header">
        <ul class="nav nav-pills pull-right">
          <li class="active"> 
             <a href="/">Home</a>
          </li>  
          {{#each menu}}
          <li>  
            <a href="#{{route}}">{{name}}</a>
          </li>
          {{/each}}
        </ul>
        <h3 class="text-muted">{{sitetitle}}</h3>
      </div>
      <div class="jumbotron">
        <h1>{{feature.title}}</h1>
        <img src="{{feature.image}}"/>   
        <p class="lead">{{feature.body}}</p>
      </div>
      <div class="marketing">  
        {{#each features}}
        <div class="media">
          <a class="pull-left"> 
            <img src="{{ image }}" class="img-thumbnail"/> 
          </a>
          <div class="media-body">
            <h4 class="media-heading">{{ title }}</h4>
            <p>{{ body }}</p>
          </div>
        </div>
        {{/ each }}
      </div>
      <div class="footer">
        <p>{{sitecopy}}</p>
      </div>  
    </script>
  </div>
  <!-- build:js scripts/vendor.js -->

The preceding code is very similar to the HTML that was created by Yeoman, except we are replacing the static content with data for Handlebars to compile the template with dynamic configuration data. Now, let's initialize the application by adding the following script block at the bottom of the app/index.html file in the app folder that was created during the initial scaffold:

  <!-- build:js({app,.tmp}) scripts/main.js -->
  <script src="scripts/main.js"></script>
  <!-- endbuild -->
  <script>
    $(document).ready(function() {
      App.init({
        el: '.container',
        sitetitle : 'Learning Yeoman',
        sitecopy : '2014 Copyright',
        version: '0.0.1',
        feature : {
          title : 'Chapter 1',
          body : 'a starting point for a modern web app.',
          image : 'http://goo.gl/kZZ6dX',
          endpoint : 'http://jonniespratley.me:8181/api/v2/learning-yeoman-ch1/posts'
        },
        features : null,
        menu: [
          {name: 'About', route: '/about'},
          {name: 'Contact', route: '/contact'}
        ]
      });
    });
  </script>

In the preceding code, we perform the following steps:

  1. First, we use jQuery's ready method to wait for the document to finish loading before executing the contents.
  2. Then, a new instance of the App class is created, passing in the site configuration options.
  3. The endpoint property is set to a simple API endpoint used to access the features data.
  4. The el property is set to the div.container element in the index.html page.
  5. Then, general site information such as the title, version, and copyright is declared.
  6. The site feature information is populated with default content, and the site navigation menu array is defined with two items that represent pages.
  7. Save the file, and you will see your browser automatically reloading with something similar to the following screenshot:
    Automation

Testing with PhantomJS

If testing is not a part of your workflow, it should be! Yeoman makes it incredibly easy to test your application by setting up a testing environment with the Mocha framework. Other options include Jasmine, QUnit, and just about any other framework. That helpful robot (Yeoman) just saved hours of development time by creating all the necessary configuration files during the initial project scaffold.

Several testing tasks can be customized to do many useful things like showing test results in JUnit for use in many continuous integration systems such as Jenkins and Bamboo. Perform the following steps:

  1. Open the Gruntfile.js file, locate the mocha task object around line #138, and configure the specific options for this target, as follows:
      ...
      //#138 - Mocha testing framework configuration options
      mocha: {
        all: {
          options: {
            run: true,
            log: true,
            reporter: 'Spec',
            files: ['<%= config.app %>/scripts/{,*/}*.js'] 
          }
        }
      },
      ...

    In the preceding code:

    • We specify where the source of the scripts are by the files property
    • The run and log properties, as you may have guessed, log the output and run the tests
    • The reporter property is Spec, so it will display the message in the console
  2. Then, the files property sets the location of the test specs. Open the default test the generator created, test/spec/test.js, and add the following:
    /*global App, expect, it, describe */
    'use strict';
    var testApp = null;
    var config = {
      el: '.container',
      sitetitle: 'Learning Yeoman',
      sitecopy: '2014 Copyright',
      version: '0.0.1',
      feature: {
        title: 'Chapter 1',
        body: 'a starting point for a modern web application.',
        image: 'http://goo.gl/kZZ6dX',
        endpoint: '/posts'
      },
      features: null
    };
    testApp = App.init( config );
    describe( 'Learning Yeoman Chapter 1 Test', function () {
      describe( 'App.init', function () {
        it( 'should store config on instance', function (done) {
            expect( testApp.config.version, 'App.config' ).to.equal( config.version );
            done();
        } );
      } );
    } );

    In the preceding code:

    • First, the JShint configuration at the top defines global variables used in the spec
    • The describe block contains some local variables that define the application's configuration
    • The it block is testing if the configuration options passed to the App.init method are correctly set on the config property of the testApp instance

Running tests

To run the tests, use the following command:

$ grunt test

The output in the console should look similar to the following screenshot:

Running tests

As we can see from the output, the configuration of PhantomJS is already taken care of. It nicely starts the PhantomJS browser; after connecting to the browser, it logs the output to the console as the tests run.

Optimizing for production

The default Grunt task ($ grunt) takes care of optimizing your entire project by doing the following:

  • Compiles and concatenates all style sheets together
  • Minifies all referenced third-party libraries into a separate file
  • Groups Angular modules into a separate minimized file
  • Then, it combines all application scripts into one separate file
  • All HTML files and images are processed through their corresponding optimizer
  • All processed files have a revision number appended to the filename
  • All built files are located in the dist directory, making your application ready for deployment
  • To preview what your application runs like once optimized, execute the following command:
    $ grunt serve:dist
    
  • Your webapp is fully optimized with fewer requests; now, it loads much faster in the browser, as shown in the following screenshot:
    Optimizing for production

See for yourself; open Chrome Developer Tools and click on the Network tab.

Self-test questions

The following are some questions that you should be able to answer after reading this chapter. If you get stuck on a question, the answers are located in the Appendix.

  1. Which four Yeoman generators are the most popular among the community?
  2. What are the three core tools used in Yeoman?
  3. What is the general developer tool workflow when using Yeoman?
  4. Which platform and environment does Yeoman run in?
  5. Who created Yeoman?

Summary

That was a lot to take in for the first chapter, but we have much more to cover. In this chapter, we learned how to install all the tools in the Yeoman workflow with one easy command: npm install yo -g. We learned about the commands that the Bower, Grunt, and Yo webapp generators have to offer. We also got to see the LiveReload server in action while making changes to the generated files.

We were able to make sure our coding syntax was error-free via JSHint. We also got our hands dirty configuring the mocha task and a unit test to make sure the app is functioning properly; we wrapped it up by taking a look at the optimization that takes place when your project is ready to ship.

Next, we are going to turn it up a notch by introducing the most popular Yeoman generators in the community: the Angular, Backbone, and Ember generators.

Left arrow icon Right arrow icon

Description

If you are a web developer with some experience in JavaScript and want to enter the world of modern web applications, then this book is ideal for you. Learning how to leverage the three tools (Yo, Bower, and Grunt) in the Yeoman workflow will be perfect as your next step towards building scalable, dynamic, and modern web applications for just about any platform.

What you will learn

  • Rediscover your workflow with the power of Yo, Bower, and Grunt
  • Use Yo, the scaffold tool, to create parts of your app from boilerplate templates
  • Use Bower, the package tool, to search, install, and update your clientside dependencies
  • Use Grunt, the build tool, to automate repetitive tasks by linting, previewing, and testing
  • Use the Grunt API to create custom tasks that can be shared between projects
  • Create custom libraries using community best practice templates that are published to Bower and npm
  • Utilize the Yeoman API to create testable custom generators that run in the Node.js environment
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 18, 2014
Length: 288 pages
Edition : 1st
Language : English
ISBN-13 : 9781783981380
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
Product feature icon AI Assistant (beta) to help accelerate your learning
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Aug 18, 2014
Length: 288 pages
Edition : 1st
Language : English
ISBN-13 : 9781783981380
Languages :
Concepts :
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 $ 170.97
Learning Yeoman
$54.99
AngularJS Web Application Development Blueprints
$57.99
MEAN Web Development
$57.99
Total $ 170.97 Stars icon

Table of Contents

11 Chapters
1. Modern Workflows for Modern Webapps Chevron down icon Chevron up icon
2. Getting Started Chevron down icon Chevron up icon
3. My Angular Project Chevron down icon Chevron up icon
4. My Backbone Project Chevron down icon Chevron up icon
5. My Ember Project Chevron down icon Chevron up icon
6. Custom Generators Chevron down icon Chevron up icon
7. Custom Libraries Chevron down icon Chevron up icon
8. Tasks with Grunt Chevron down icon Chevron up icon
9. Yeoman Tips and Tricks Chevron down icon Chevron up icon
A. Yeoman Resources Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Mike Ludemann Jul 17, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Alle wichtigen Information und mehr sind vorhanden.
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 digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

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
Modal Close icon
Modal Close icon