The Node Craftsman Book
The Node Craftsman Book
An advanced Node.js tutorial
About the Book
- How can you connect to a database like MongoDB or MySQL from your Node.js application?
- How do you write unit tests and end-to-end tests for your code?
- How do you leverage migrations for setting up a continuous deployment workflow?
- How does the Node Package Manager, NPM, work in detail?
- How do you keep your code fast and efficient by leveraging asynchronous and non-blocking operations?
- How do you use and create event emitters?
- How do you write full-fledged web applications using REST frameworks?
- How do you integrate Node.js with AngularJS?
- ...and much more!
- Special notice
- Notes on code formatting
- Intended audience
Part 1: Node.js basics in detail
- Introduction to Part 1
- Working with NPM and Packages
- Test-Driven Node.js Development
- Blueprints versus finger-pointing
- A classless society
- Creating objects
- Object-orientation, prototyping, and inheritance
- A classless society, revisited
Synchronous and Asynchronous operations explained
- Visualizing the Node.js execution model
- Blocking and non-blocking operations
Using and creating Event Emitters
- Creating your own Event Emitter object
Optimizing code performance and control flow management using the async library
- Executing expensive asynchronous background tasks in parallel
- Optimizing code structure with async
Efficient real-time web applications with the WebSocket protocol
- Where WebSocket connections beat HTTP connections
- How WebSocket connections work
- How to use WebSocket connections in your web application
- Extending the application
Node.js and MySQL
- Using the “mysql” library
- A first database application
- Using the Streaming API
- Making SQL queries secure against attacks
Node.js and MongoDB
- Some MongoDB basics
- Applying CRUD operations with the low-level mongodb driver
- Retrieving specific documents using filters
- More complex update operations
- Working with indexes
- Querying collections efficiently
Part 2: Building a complete web application with Node.js and AngularJS
- The requirements from a user’s perspective
- High level architecture overview
- Setting up the development environment
- Milestone 1: A first passing test against the server
Milestone 2: The API responds with actual database content
- Abstracting database access
- Ensuring a clean slate for test runs
- Completing the first spec
Milestone 3: Setting the stage for a continuous delivery workflow
- Introducing automatic database migrations
Milestone 4: Giving users a frontend
- Setting up frontend dependencies through bower
- Serving the frontend through the backend server
- Adding the frontend code
- Adding AngularJS view templates
Milestone 5: More work on the backend
- Adding a route for retrieving categories
- Making the backend recognize different environments
Milestone 6: Completing the backend and finalizing the application
- Creating the route for adding new keywords
- Creating the route for updating keywords
- Creating the route for deleting keywords
- One last thing…
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.