JavaScript with PromisesAsynchronous JavaScript is everywhere, whether you're using Ajax, AngularJS, Node.js, or WebRTC. This practical guide shows intermediate to advanced JavaScript developers how Promises can help you manage asynchronous code effectively - including the inevitable flood of callbacks as your codebase grows. You'll learn the inner workings of Promises and ways to avoid difficulties and missteps when using them.
The ability to asynchronously fetch data and load scripts in the browser broadens the capabilities of JavaScript applications. But if you don't understand how the async part works, you'll wind up with unpredictable code that's difficult to maintain. This book is ideal whether you're new to Promises or want to expand your knowledge of this technology. ...
JavaScript Regular ExpressionsRegular expressions are patterns or templates that allow you to define a set of rules in a natural yet vague way, giving you the ability to match and validate text. Therefore, they have been implemented in nearly every modern programming language. JavaScript's implementation allows us to perform complex tasks with a few lines of code using regular expressions to match and extract data out of text.
This book starts by exploring what a pattern actually is and how regular expressions express these patterns to match and manipulate user data. You then move on to learning about the use of character classes to define a wild character match, a digit match, and an alphanumeric match. You will then learn to manipulate text and shorten data in URLs, paths, markup, and data exchange, as well as other advanced Regex features.
Finally, you will work through real-world examples, both in the browser and on the server side using Node.js. ...
Learning WebRTCThe book begins by teaching you how to capture audio and video streams from the browser using the Media Capture and Streams API.
You will then create your first WebRTC application capable of audio and video calling. The book will also give you in-depth knowledge about signaling and building a signaling server in Node.js. While being introduced to the RTCDataChannel object, you will learn how it relates to WebRTC and how to add text-based chat to your application. You will also learn to take your application further by supporting multiple users through different technologies and scale its performance and security. This book will also cover several theories using full mesh networks, partial mesh networks, and multipoint control units. By the end of this book, you will have an extensive understanding of real-time communication and the WebRTC protocol and APIs. ...
WebSocketUntil recently, creating desktop-like applications in the browser meant using inefficient Ajax or Comet technologies to communicate with the server. With this practical guide, you'll learn how to use WebSocket, a protocol that enables the client and server to communicate with each other on a single connection simultaneously. No more asynchronous communication or long polling!
For developers with a good grasp of JavaScript (and perhaps Node.js), author Andrew Lombardi provides useful hands-on examples throughout the book to help you get up to speed with the WebSocket API. You'll also learn how to use WebSocket with Transport Layer Security (TLS). ...
The Definitive Guide to MongoDB, 3rd EditionThe Definitive Guide to MongoDB, Third Edition, is updated for MongoDB 3 and includes all of the latest MongoDB features, including the aggregation framework introduced in version 2.2 and hashed indexes in version 2.4. The Third Edition also now includes Node.js along with Python.
MongoDB is the most popular of the "Big Data" NoSQL database technologies, and it's still growing. David Hows from 10gen, along with experienced MongoDB authors Peter Membrey and Eelco Plugge, provide their expertise and experience in teaching you everything you need to know to become a MongoDB pro. ...
Apple Pay EssentialsApple Pay, one of the most talked about offerings of the latest iOS 9 release, is a digital wallet and electronic payment system developed by Apple Inc. Paying in stores or within apps has never been easier or safer. Gone are the days of searching for your wallet, and the wasted moments finding the right card! Now you can use your credit cards and rewards cards with just a touch.
It allows payment to merchants, using Near field Communication (NFC), and within iOS apps. Implementing Apple Pay within apps for payment is a bit tricky, but our book solves this problem for you.
Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with necessary skills to successfully implement Apple Pay in your online-payment workflow.
Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with the necessary skills to successfully implement Apple Pay. We start off by teaching you how to obtain the certificates necessary to encrypt cu ...
Learning Behavior-driven Development with JavaScriptJavaScript is not only widely used to create attractive user interfaces for the Web, but with the advent of Node.js, it is also becoming a very popular and powerful language to write server-side applications. Using behavior-driven development and some common testing patterns and best practices, you will be able to avoid these traps.
This book will show you how to do BDD in a practical way. We will start with a basic introduction of what BDD is and why the classical approach to testing has failed. Afterwards, we will dive directly into an introduction to Node.js, Mocha, and Sinon.JS. Finally, we will cover more advanced subjects such as how to write a fast and effective test suite for a RESTful web API, and how to do the same with a rich UI using Cucumber.js and Protractor.
This book will give you great insight into how to architect your system to make it more testable and modular, but at the same time avoid the nightmare of abusing mock objects. ...
Mastering Modular JavaScriptTackle two aspects of JavaScript development, modularity and ECMAScript 6 (ES6). With this practical guide, frontend and backend Node.js developers alike will learn how to scale out JavaScript applications by breaking codebases into smaller modules. Author Nicolas Bevacqua also covers features in ES6 - the latest version of the specification that includes JavaScript - that support modularization.
If you're a frontend developer or backend Node.js developer with a working knowledge of JavaScript, this book is for you. It's ideal for semi-senior developers, senior developers, technical leaders, and software architects. ...
JSON at WorkJSON is becoming the backbone for meaningful data interchange over the internet. This format is now supported by an entire ecosystem of standards, tools, and technologies for building truly elegant, useful, and efficient applications. With this hands-on guide, author and architect Tom Marrs shows you how to build enterprise-class applications and services by leveraging JSON tooling and message/document design.
JSON at Work provides application architects and developers with guidelines, best practices, and use cases, along with lots of real-world examples and code samples. You'll start with a comprehensive JSON overview, explore the JSON ecosystem, and then dive into JSON's use in the enterprise.
Get acquainted with JSON basics and learn how to model JSON data; Learn how to use JSON with Node.js, Ruby on Rails, and Java; Structure JSON documents with JSON Schema to design and test APIs; Search the contents of JSON documents with JSON Search tools; Convert JSON documents to other d ...
Test-Driving JavaScript ApplicationsDesign and code JavaScript applications with automated tests. Writing meaningful tests is a skill that takes learning, some unlearning, and a lot of practice, and with this book, you'll hone that skill. Fire up the editor and get hands-on through practical exercises for effective automated testing and designing maintainable, modular code.
Start by learning when and why to do manual testing vs. automated verification. Focus tests on the important things, like the pre-conditions, the invariants, complex logic, and gnarly edge cases. Then begin to design asynchronous functions using automated tests. Carefully decouple and mock out intricate dependencies such as the DOM, geolocation API, file and database access, and Ajax calls to remote servers.
Step by step, test code that uses Node.js, Express, MongoDB, jQuery, and AngularJS. Know when and how to use tools such as Chai, Istanbul, Karma, Mocha, Protractor, and Sinon. Create tests with minimum effort and run them fast without having ...