Egghead Instructor Will Button

Will Button

Startups | Fitness | Data | Performance



Unlock all of Will's PRO Lessons
click for instant access!

Browse Will Button's lessons.

showing 57 lessons...

Convert a callback to a promise

Difference between tilde (~) and caret (^) in package.json

Use ES6 style Promises with Node.js

Identify memory leaks with nodejs-dashboard

Create an API with Swagger

Build Monitoring into your API Server

P

Perform Load Tests on an API Server using Apache jmeter

P

Connect an existing React application to an API server created with Swagger

P

Create a Node.js function for an HTTP PUT request for a Swagger API

P

Create a Node.js function for an HTTP GET request with URL parameters

P

Create a Node.js function for an HTTP POST request for a Swagger API

P

Create a Node.js function for an HTTP DELETE request for a Swagger API

P

Create a Node.js function for an HTTP GET request for a Swagger API

P

Define an HTTP DELETE Endpoint for a Node.js API Server with Swagger

P

Mock API Responses with Swagger

P

Define an HTTP PUT Endpoint for a Node.js API Server with Swagger

P

Define an HTTP GET Endpoint with URL Parameters for a Node.js Server with Swagger

P

Define an HTTP POST Endpoint for a Node.js Server with Swagger

P

Define an HTTP GET Endpoint for a Node.js API Server with Swagger

P

Create An API Schema Definition Using Swagger

P

Pass command line arguments to node.js

Use nodejs-dashboard event loop delay

Use Realm Object Database with Node.js

Install nodejs-dashboard

Testing ES6 Promises in Node.js using Mocha and Chai

Deploy Node.js on Docker

P

Changes to Buffers in Node.js 6

P

Using npm scripts to deploy to a Vagrant image

P

Configuring AWS Elastic Load Balancers

P

Scheduling Events with AWS Lambda (a.k.a. Lambda cron jobs)

P

Installing the AWS CLI on OS X and Linux

Speed Up Your Website by Using AWS CloudFront

Using jq to parse the Star Wars API

Permission denied (publickey) when SSH Access to Amazon EC2 instance

Hosting a Static Website on Amazon S3

Managing Memory and Garbage Collection in Node.js

P

Including dependencies in your AWS Lambda function

P

Use AWS Lambda and API Gateway to return resume data

Using EventEmitters in Node.js

P

Publishing a Module to the NPM Registry

P

Using the node.js http server

P

Creating a Node.js module

P

Using the Node.js net module to create a tcp server

P

Finding and installing packages in your node application using npm

Exporting Modules in Node

P

Introduction to Node.js Modules

P

Node.js Buffers

Node.js Global Namespace

The node.js process object

Understanding Callbacks in Node.js

P
js tutorial about Convert a callback to a promise

Convert a callback to a promise

4:45 js

Promises are rapidly overtaking callbacks in popularity. In this lesson, I show you how to rewrite a callback using ES6 Promises. After getting a handle on the basics, we'll convert an error-first style callback to use the Resolve and Reject handlers built into Promises. If you aren't familiar with Promises, this lesson can be a great starting point by learning how to duplicate the behavior of a callback with ES6 Promises.

node tutorial about Difference between tilde (~) and caret (^) in package.json

Difference between tilde (~) and caret (^) in package.json

2:36 node

As a beginning node.js user, you will often see the tilde (~) or caret (^) in front of the version number for dependencies managed by your package.json file. In this lesson, you will learn what each means, when to use it, the implications of each and a brief introduction to Semantic Versioning.

node tutorial about Use ES6 style Promises with Node.js

Use ES6 style Promises with Node.js

5:56 node

Using promises can be confusing. In this lesson, I show you how to create promises to chain functions together in a specified order. You'll also learn how to pass the return value of promises as the input parameters of promises further down the chain. All examples in this lesson utilize native ES6 style promises, which are fully supported by recent versions of node.js without any dependencies.

node tutorial about Identify memory leaks with nodejs-dashboard

Identify memory leaks with nodejs-dashboard

2:12 node

In this lesson, I introduce a memory leak into our node.js application and show you how to identify it using the Formidable nodejs-dashboard. Once identified, we will add garbage collection stats to the error console allowing us to correlate garbage collection with the increased memory usage.

node tutorial about Create an API with Swagger

Create an API with Swagger

3:56 node

Swagger is a project used to describe restful APIs using the OpenAPI Specification. It allows you to document your API so consumers understand the endpoints, parameters, and responses. In this lesson, I'll show you how to install the swagger command line tool, create a new API project using swagger, and introduce you to the swagger API editor.

node tutorial about Build Monitoring into your API Server

Build Monitoring into your API Server

7:06 node PRO

There are a lot of great monitoring tools available for Node.js. It is also incredibly easy to build monitoring into your application. In this lesson, we will add precision monitoring to the function calls in the Todo API server, log it to the console, and persist those results to Elasticsearch where they can later be reviewed, graphed, and analyzed.

node tutorial about Perform Load Tests on an API Server using Apache jmeter

Perform Load Tests on an API Server using Apache jmeter

8:25 node PRO

The last step before deploying your new API server into production is to load test it. Load testing allows you to better understand the performance characteristics as well as forecast load and capacity. Fortunately, load testing is incredibly easy and I'll show you exactly how to create a load test plan, test the response from the API server to ensure it is responding correctly, and scale your test up to simulate as many users as needed.

node tutorial about Connect an existing React application to an API server created with Swagger

Connect an existing React application to an API server created with Swagger

6:01 node PRO

In this lesson, I will show you how to update a simple, skeleton React application to work with the Todo API server built with Swagger. Using existing components, you will learn how to display all Todo items, update an existing Todo item, and add a new Todo item.

node tutorial about Create a Node.js function for an HTTP PUT request for a Swagger API

Create a Node.js function for an HTTP PUT request for a Swagger API

2:52 node PRO

This lesson will teach you how to update a Todo item in Elasticsearch when received from an HTTP PUT method in your API server built with Swagger.

node tutorial about Create a Node.js function for an HTTP GET request with URL parameters

Create a Node.js function for an HTTP GET request with URL parameters

3:33 node PRO

In this lesson, you will learn how to create a function in your Node.js Todo API server that gets the ID of the Todo item being requested from the URL and retrieve the Todo item from Elasticsearch.

node tutorial about Create a Node.js function for an HTTP POST request for a Swagger API

Create a Node.js function for an HTTP POST request for a Swagger API

4:41 node PRO

This lesson shows you how to create the functions defined in the Todo API specification to create new Todo items when received in HTTP POST methods. You will also see the errors you will get when CORS is not properly configured and how to resolve them by installing the NPM CORS package.

node tutorial about Create a Node.js function for an HTTP DELETE request for a Swagger API

Create a Node.js function for an HTTP DELETE request for a Swagger API

2:45 node PRO

This lesson shows you how to delete a Todo item from Elasticsearch using the Todo ID from the URL parameters according to the specifications defined in your Swagger API docs.

node tutorial about Create a Node.js function for an HTTP GET request for a Swagger API

Create a Node.js function for an HTTP GET request for a Swagger API

5:42 node PRO

This lesson will teach you how to create the javascript functions defined by the Swagger specification to return all Todo items to the client when requested with an HTTP GET method.

node tutorial about Define an HTTP DELETE Endpoint for a Node.js API Server with Swagger

Define an HTTP DELETE Endpoint for a Node.js API Server with Swagger

1:02 node PRO

This lesson demonstrates how to access the ID of a Todo item being deleted from the URL parameters when used with an HTTP DELETE method.

node tutorial about Mock API Responses with Swagger

Mock API Responses with Swagger

2:51 node PRO

APIs created with Swagger have a built-in mock function, allowing you to mock responses from your API prior to writing the backend code to make it functional. In addition to learning how to enable this feature, I will show you how to write your own functions to enhance the mock responses returned when using the Swagger mock feature.

node tutorial about Define an HTTP PUT Endpoint for a Node.js API Server with Swagger

Define an HTTP PUT Endpoint for a Node.js API Server with Swagger

0:57 node PRO

In this lesson, you will learn how to define multiple parameters in the API specification to identify the ID of the Todo item being updated in the URL, as well as the contents for the updated Todo item in the body of the request.

node tutorial about Define an HTTP GET Endpoint with URL Parameters for a Node.js Server with Swagger

Define an HTTP GET Endpoint with URL Parameters for a Node.js Server with Swagger

1:35 node PRO

In this lesson, you will learn how to define an HTTP GET endpoint using Swagger with URL parameters to identify the ID of the Todo item being requested.

node tutorial about Define an HTTP POST Endpoint for a Node.js Server with Swagger

Define an HTTP POST Endpoint for a Node.js Server with Swagger

1:23 node PRO

In this lesson, you will learn how to define HTTP POST operations for your Todo API server using Swagger. Creating the endpoint, passing the todo in the request body, and parsing the todo are all demonstrated.

node tutorial about Define an HTTP GET Endpoint for a Node.js API Server with Swagger

Define an HTTP GET Endpoint for a Node.js API Server with Swagger

1:28 node PRO

In this lesson, you will learn how to create an HTTP GET endpoint for a node.js server using Swagger. This endpoint will be used to return all of the Todo items from Elasticsearch to the client.

node tutorial about Create An API Schema Definition Using Swagger

Create An API Schema Definition Using Swagger

2:13 node PRO

Schema definitions allow you to define the format and types of data sent and received by your API. This allows consumers of your API to be confident in using your API. In this lesson, you will learn how to create a schema definition for the Todo API server.

node tutorial about Pass command line arguments to node.js

Pass command line arguments to node.js

3:10 node

Command line arguments are often used to modify the behavior of an application or specify needed parameters for operation. In this lesson, you will learn how to access the command line arguments passed to your node.js application as well as different strategies for evaluating and accessing them.

node tutorial about Use nodejs-dashboard event loop delay

Use nodejs-dashboard event loop delay

5:45 node

In this lesson, you will learn how to use the Formidable nodejs-dashboard event loop delay to identify expensive operations in your code. An example application with excessive synchronous file system write operations is used as well as the provided jmeter configuration to simulate load.

node tutorial about Use Realm Object Database with Node.js

Use Realm Object Database with Node.js

8:03 node

Realm is an ACID compliant object database. In this lesson, you will learn how to install Realm, define schemas for your data, perform CRUD operations and persist your data to the filesystem.

node tutorial about Install nodejs-dashboard

Install nodejs-dashboard

2:54 node

In this lesson, you will learn how to install the Formidable nodejs-dashboard. You will learn what each section of the dashboard is used for and see a sample application in action.

node tutorial about Testing ES6 Promises in Node.js using Mocha and Chai

Testing ES6 Promises in Node.js using Mocha and Chai

4:53 node

Writing great ES6 style Promises for Node.js is only half the battle. Your great modules must include tests as well to ensure future iterations don't break them. In this lesson, I show you a simple ES6 Promise in Node.js, then walk you through creating tests in Mocha using chai and chai-as-promised to test both resolve and reject methods.

node tutorial about Deploy Node.js on Docker

Deploy Node.js on Docker

9:54 node PRO

Getting nodejs to run inside of Docker is relatively simple. Getting nodejs to run inside of Docker while using recommended best practices takes some planning. In this lesson, I’ll show you how to get a simple nodejs web server running in Docker on your local workstation while adhering to best practices.

node tutorial about Changes to Buffers in Node.js 6

Changes to Buffers in Node.js 6

3:14 node PRO

In versions of nodejs prior to 6, how you created a buffer and what you did with it produced different behaviors. This made it possible to introduce security or reliability issues into your code. At the time however, JavaScript had no means of reading or manipulating streams of binary data. Now that TypedArray has been added in ES6, the Buffer class implements the Uint8Array API in a manner that better suits node.js use cases.
In this lesson, you will learn what that means to your existing code and how to update your code to use the new Buffer APIs.

node tutorial about Using npm scripts to deploy to a Vagrant image

Using npm scripts to deploy to a Vagrant image

4:56 node PRO

One of the biggest stumbling blocks I see when pushing code to production servers is unidentified dependencies: something installed locally on my workstation that doesn’t exist on the production servers. In this lesson, I’ll show you how to use npm scripts to deploy your node.js application to a newly-provisioned server via Vagrant for validation before going to production.

otherjs tutorial about Configuring AWS Elastic Load Balancers

Configuring AWS Elastic Load Balancers

5:47 otherjs PRO

In this lesson, you will learn how to setup an Elastic Load Balancer for your nodejs servers. You will also learn how to configure the load balancer with servers in different availability zones, using nodejs servers that do not require root access to bind to port 80 or 443, and are not publicly accessible via the internet. You will learn how to use health checks to ensure your servers are removed from service when not responding properly and be automatically added back to the load balancer when functional again. Finally, I show you how to understand the metrics provided by the ELB to troubleshoot problems with both your backend servers and the ELB itself.

otherjs tutorial about Scheduling Events with AWS Lambda (a.k.a. Lambda cron jobs)

Scheduling Events with AWS Lambda (a.k.a. Lambda cron jobs)

5:35 otherjs PRO

Learn how to create AWS Lambda functions that execute on a scheduled interval, much like a cron job would. In this lesson we will create a Lambda function that checks for a string of text on a website to verify the website is up and operational. The lambda function logs to CloudWatch Metrics and sends a notification email using an SNS queue if the check fails.

otherjs tutorial about Installing the AWS CLI on OS X and Linux

Installing the AWS CLI on OS X and Linux

4:00 otherjs

Installing the AWS CLI on your local workstation may be one of the biggest boosts to productivity you can make if you use AWS often. Almost all AWS features are available via the CLI allowing you to script, schedule and automate many AWS related tasks.
In this lesson, I’ll show you how to setup and verify the AWS CLI.

otherjs tutorial about Speed Up Your Website by Using AWS CloudFront

Speed Up Your Website by Using AWS CloudFront

4:08 otherjs

In this lesson, you will learn how to improve your website performance by using the AWS CloudFront service. I show you how to setup CloudFront, properly configure the S3 settings, enable logging, and verify operation.

otherjs tutorial about Using jq to parse the Star Wars API

Using jq to parse the Star Wars API

2:57 otherjs

jq is a lightweight and flexible command-line JSON processor. It is extremely useful for processing data from APIs to better understand the data your code will be consuming, before you write the code. In this lesson I introduce you to jq and show you the basic features it provides using the Star Wars API (http://swapi.co) as our data source. Topics covered include filtering, piping, object construction and data manipulation.

otherjs tutorial about Permission denied (publickey) when SSH Access to Amazon EC2 instance

Permission denied (publickey) when SSH Access to Amazon EC2 instance

2:53 otherjs

There are two likely causes to the "Permission denied (public key)" error encountered with AWS EC2 instances: incorrect ssh keys and incorrect usernames. In this lesson, I'll address both and show you how to overcome them.

otherjs tutorial about Hosting a Static Website on Amazon S3

Hosting a Static Website on Amazon S3

4:19 otherjs

In this lesson, you will learn how to host a static website on Amazon S3. I will show you how to create the buckets, create the bucket policy to allow public access and point your own custom DNS name to the website.

node tutorial about Managing Memory and Garbage Collection in Node.js

Managing Memory and Garbage Collection in Node.js

8:40 node PRO

In this lesson, you will learn how to use view and interpret the garbage collection activity of your node.js app via the console. You will also learn how to take heapdump snapshots and analyze them with Chrome Developer Tools to identify possible memory leaks. A sample app with a known memory leak is provided as part of the walk-through to illustrate how to use the tools in your own environments.

node tutorial about Including dependencies in your AWS Lambda function

Including dependencies in your AWS Lambda function

5:07 node PRO

This lesson teaches you how to use dependencies, such as faker.js in your Lamdba functions. We will update the lambda code from the Lambda and API Gateway lesson to generate random work history and endorsements using the faker npm module then upload our code to Lambda and test.

node tutorial about Use AWS Lambda and API Gateway to return resume data

Use AWS Lambda and API Gateway to return resume data

5:35 node

In this lesson, you will learn how to create a simple AWS Lambda function to submit a name via an API Gateway and return a resume for that person. At the end of the lesson, you will be able to create a Lambda function, and API Gateway, and understand how to submit data via the API Gateway that will be accessible via the Lambda function

node tutorial about Using EventEmitters in Node.js

Using EventEmitters in Node.js

6:00 node PRO

In this lesson, you will learn what an EventEmitter is and how it works. We start with a simple example creating an instance of the EventEmitter class, then expand on it by building listeners and emitting events to trigger them. You will learn how to view listeners in the global emitter object, as well as how to remove them and understand what the EventEmitter memory leak message means. We wrap everything up by examining the http server class to illustrate how node.js uses EventEmitters in many places for core features.

node tutorial about Publishing a Module to the NPM Registry

Publishing a Module to the NPM Registry

3:22 node PRO

This lesson shows you how to:
* create a user account on the npm registry
* publish your module to the registry
* use npm version to bump the version number of your package
* publish updated versions of your module to the registry
* unpublish modules from the registry

node tutorial about Using the node.js http server

Using the node.js http server

4:08 node PRO

In this lesson, you will learn how to build a simple http server that serves different content based on routes (a.k.a. the url requested by the client) as well as the http method used.

node tutorial about Creating a Node.js module

Creating a Node.js module

4:30 node PRO

Sharing code and extending functionality in node.js is often done with modules. In this lesson, you will learn how to use npm init to scaffold a new module, verify proper installation, and identify the components needed to publish your module to public and private registries.

node tutorial about Using the Node.js net module to create a tcp server

Using the Node.js net module to create a tcp server

3:54 node PRO

In this lesson, you'll learn how to include the built-in node.js 'net' module in your application and create a tcp server. You will learn about the different event listeners used, how to specify specific ports and addresses for your server, and identify where each section of your code is used in the server lifecycle.

node tutorial about Finding and installing packages in your node application using npm

Finding and installing packages in your node application using npm

8:14 node

In this lesson, you will learn how to find packages to add functionality to your application. You will also learn some valuable tips on how to choose a stable, supported package. We also demonstrate how to install packages using npm and the two simple rules to understand when you should install globally with the -g flag or install the package locally. The dependency section of package.json is used to show how to manage dependencies for both production and development packages. Finally, the caret (^), tilde(~), and star (*) wildcards are explained to control which versions your package is compatible with as well as installing package dependencies from git repos.

node tutorial about Exporting Modules in Node

Exporting Modules in Node

5:50 node PRO

In this lesson, you will learn the difference between the exports statement and module.exports. Two examples are demonstrated, each accomplishing the same task but one using export statements and one using module.exports. You will also learn the basic thumb rule to identify which is appropriate for your current needs.

node tutorial about Introduction to Node.js Modules

Introduction to Node.js Modules

6:23 node PRO

In this lesson, we introduce modules: what they are and how to use them. You'll learn:
how to create a simple module and export the functions to be accessed elsewhere
how to include code from your module in files within your application
the three rules node uses to find the modules you require
the hierarchy node uses to determine which modules take precedence
which file extensions node can automatically detect when requiring modules

node tutorial about Node.js Buffers

Node.js Buffers

10:30 node

In this lesson, we cover the Node.js Buffer object in detail. Not only will you learn that the buffer object is a reference to a memory space outside of the V8 engine, but you will learn practical methods to access it, modify it, and convert it to standard Javascript objects that can be used by your code. Examples and discussion are provided for using the toString() method, determining the byte length of the buffer, writing to a buffer, how to avoid truncating data, comparing buffers for equality using both compare() and equals(), and copying buffers using slice().

node tutorial about Node.js Global Namespace

Node.js Global Namespace

4:42 node

In this lesson, we introduce the node global namespace object and demonstrate how global variables in node may not behave the way you think they do. We also briefly discuss the global 'require' object and how it operates in the global namespace.

node tutorial about The node.js process object

The node.js process object

6:26 node

In this lesson, we introduce the process object, part of the node.js global namespace. The process object is extremely useful for identifying information about the runtime environment of your node app such as the version of node, the arguments passed to the node executable, the current working directory, and the nextTick function. All of these are discussed and illustrated with examples in this lesson.

node tutorial about Understanding Callbacks in Node.js

Understanding Callbacks in Node.js

7:03 node PRO

In this lesson you will learn what callbacks are, how to use them and why we use them in our Node applications. We start with a simple javascript function and build a second function that uses it as a callback to understand the basic operation of a callback. From there, we create a few more functions that help illustrate how using callbacks can help us keep our code legible and organized as well as allowing us to use generic functions that can bring in extra functionality when needed via the callback.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?