Mitch Allen

Something went wrong. Please try your request again later.
Follow to get new release updates and improved recommendations
OK
About Mitch Allen
Mitch Allen has worked for software and robotics companies in Silicon Valley, along Boston's Route 128 and in New York's Silicon Alley. http://mitchallen.com
Are you an author?
Help us improve our Author Pages by updating your bibliography and submitting a new or current image and biography.
There's a problem loading this menu right now.
Get free delivery with Amazon Prime
Prime members enjoy FREE Delivery and exclusive access to music, movies, TV shows, original audio series, and Kindle books.
Books By Mitch Allen
$2.99
The purpose of this book is to show you how to design and create node.js modules. Node.js modules are external functions or objects that you can integrate into your project. You can think of them as a library. They are written in separate JavaScript files and can be assigned to a variable in your main file with one line of code. If you know how to write JavaScript you know to create a module.
Node.js projects can grow very quickly to the point where they will no longer fit into one *.js file. Modules are a way to break the code up into manageable and testable chunks. With browser based JavaScript, HTML script tags are one way to pull multiple source files into one place. Node.js doesn’t have that option. Instead, it relies on the built-in require module to pull code from one JavaScript file into another.
This book walks through the steps of designing and creating node.js modules. It starts with how to convert JavaScript objects into modules and export them for external use. Other areas that this book covers include: naming exports, constructor parameters, properties, methods, inheritance, callbacks, promises and unit testing.
Here is a more detailed breakdown of the book by chapter:
Why Modules?
Node.js projects can grow very quickly to the point where they will no longer fit into one *.js file. Modules are a way to break the code up into manageable and testable chunks. With browser based JavaScript, HTML script tags are one way to pull multiple source files into one place. Node.js doesn’t have that option. Instead, it relies on the built-in require module to pull code from one JavaScript file into another.
What this Book Covers
This book walks through the steps of designing and creating node.js modules. It starts with how to convert JavaScript objects into modules and export them for external use. Other areas that this book covers include: naming exports, constructor parameters, properties, methods, inheritance, callbacks, promises and unit testing.
Here is a more detailed breakdown of the book by chapter:
- Objects as Modules - The book starts with the creation of a simple module which returns a single object. A factory based module is introduced that can create multiple objects. Learn how to seal an object to protect it from changes.
- Properties - The next step after defining objects is to add properties. Learn how to add properties that can be enumerated and protected against invalid values.
- Methods - Methods are what functions are called when they are part of an object. Define methods that can accept named parameters. Learn how to chain methods together and guard against invalid parameters.
- Module Parameters - Modules can be passed parameters, just like a functions or methods. Learn how to pass parameters to a module or a factory function to construct objects.
- Named Exports - Instead of returning the whole module, only return part of it. Learn how to export named objects and functions and special techniques for naming factory related exports.
- Inheritance - Modules and objects can be derived from other modules and objects. Learn how to derive and combine objects and override methods in parent objects.
- Callbacks - When using third party libraries with callbacks, care must be taken to integrate them into a module. Learn how to create modules that wrap existing callbacks and define new callbacks.
- Promises - Callbacks calling callbacks calling callbacks can get out of hand. Learn how to create modules that wrap third party callbacks in promises and define new promises.
- Unit Testing - When making changes to a module it is handy to be able to run a suite of tests to make sure that nothing broke. It’s also helpful to make sure that new functionality works as expected. Learn how to create and run unit tests against modules.
$2.99
This book walks through the steps of creating and publishing node.js packages to a public repository. It starts with an introduction and provides the code for a simple module. Then it walks through the steps of creating a package, applying a packaging tool, adding unit tests and source control. Once those steps are completed, you will learn how to publish your new package and handle updates. As a bonus chapter, you will also learn how to create a command line utility.
This book walks through the steps of creating and publishing node.js packages to a public repository (repo). It starts with an introduction and provides the code for a simple module. Then it walks through the steps of creating a package, applying a packaging tool, adding unit tests and source control. Once those steps are completed, you will learn how to publish your new package and handle updates. As a bonus chapter, you will also learn how to create a command line utility.
Here is a more detailed breakdown of the book by chapter:
What this Book Covers
This book walks through the steps of creating and publishing node.js packages to a public repository (repo). It starts with an introduction and provides the code for a simple module. Then it walks through the steps of creating a package, applying a packaging tool, adding unit tests and source control. Once those steps are completed, you will learn how to publish your new package and handle updates. As a bonus chapter, you will also learn how to create a command line utility.
Here is a more detailed breakdown of the book by chapter:
- Node Package Manager - The book starts out by introducing the Node Package Manager (npm for short). After a brief overview, instructions are given on how to install the npm tool and how to add a user to the npm site. The npm site is where you can publish your packages.
- Calculator Example - Even though the book is about publishing and not programming, you will need to have something to publish. This chapter provides a simple calculator module that you are free to use, modify and publish.
- Creating a Package - Setup your project and turn it into a package using the npm command line tool. Learn about the special package file that the tool generates. Create an ignore file to control what actually goes into your package. Once you are familiar with the steps, you will be able to turn any module into a package.
- Unit Testing - Learn how to use two popular tools to build test suites for your project. You will also learn about another tool that lets you monitor the live effect of source code changes while you are working.
- Source Control - Get an introduction to the popular source control tool called git. Learn how to publish the source code for your package to github.com.
- Documentation - Document your work with a README file. Get started with an introduction to the Markdown syntax. Learn by example what sections a package README file should have and what they should look like.
- Publishing a Package - Once you know how to build, test, document and check your package code into source control, you will be ready to publish it. Walk through the steps to put your package online.
- Creating Examples - Documentation is great, but example code is even better. Add examples to your project in a way that will make them easy to find.
- Publishing Updates - When updating your package, learn how to apply the rules of semantic versioning to your build numbers. Then remember to add new tests, document the version history and push the changes to source control.
- Creating a Command Line Utility - As a bonus chapter, this book also covers using JavaScript and npm to create a command line utility.
More Information
Anything else? Provide feedback about this page