hello.js

var please = require('share');
console.log('thank you');

Monday, 7 January, 2019 UTC

node: Reduce Boilerplate with yargs middleware in a Node.js Command Line Tool

node: Reduce Boilerplate with yargs middleware in a Node.js Command Line Tool

Sometimes you might want to transform arguments before they reach the command handler. For example, perhaps you want to validate that credentials have been provided and otherwise load credentials from a file. Middleware is simply a stack of functions, ... more


Wednesday, 2 January, 2019 UTC

javascript: Refactor es5 functions to es6 arrow functions

javascript: Refactor es5 functions to es6 arrow functions

In this lesson we'll learn how to refactor es5 functions into es6 arrow functions to decrease visual noise in our program. We'll take a step by step approach, increasing clarity with each rewrite. ... more


Thursday, 20 December, 2018 UTC

javascript: Freeze a JavaScript object with an Object.freeze method

javascript: Freeze a JavaScript object with an Object.freeze method

Even though JavaScript is a very dynamic language, sometimes we want to be _extra_ sure that it's not possible to modify an object once it was declared. Luckily, there's a method called `Object.freeze` which allows us to freeze an object so it's not possible ... more


Thursday, 13 December, 2018 UTC

javascript: Bundle and Run HTML and JavaScript in the Browser with Parcel

javascript: Bundle and Run HTML and JavaScript in the Browser with Parcel

# Up and Running with Parcel JS In this video, we will get up and running with Parcel by creating a simple Hello World application in JavaScript. ## What is Parcel? Parcel is a zero configuration web application bundler and Webpack alternative. It supports ... more


Thursday, 13 December, 2018 UTC

node: Deploy a Monorepo to Now V2

node: Deploy a Monorepo to Now V2

Now by Zeit has recently been updated and now supports multi-language monorepos. In this lesson we'll build and deploy a simple app with an API powered by Node.js and Go. If you want to follow along with this lesson, you will need to install [now-cli](https://github.com/zeit/now-cli). ... more


Thursday, 13 December, 2018 UTC

[Course] react: Modern JavaScript Tooling with React

[Course] react: Modern JavaScript Tooling with React

Building an application with React typically involves several tools. Whether you configure these on your own or use a tool meant to save you from the configuration like Create React App, the tools are still there. When you come up against a situation ... more


Thursday, 13 December, 2018 UTC

[Course] react: Progressive Web Apps in React with create-react-app

[Course] react: Progressive Web Apps in React with create-react-app

Progressive Web Apps (PWAs) allow a user to use your web app online or offline, and lets them install the app onto their iOS or Android device just like a native app. Sounds great, right? But it can be tricky to properly configure a PWA, and not every ... more


Tuesday, 11 December, 2018 UTC

[Course] javascript: Algorithms in JavaScript

[Course] javascript: Algorithms in JavaScript

Algorithms are functions that are used to solve a class of problems. Really any piece of code can be a algorithm! There are common algorithm implementations that have proven to accomplish tasks faster than others. However, speed is not measured in seconds ... more


Monday, 10 December, 2018 UTC

[Course] react: Reusable State and Effects with React Hooks

[Course] react: Reusable State and Effects with React Hooks

Previously, in order to add state or side-effects in React you had to create a Class Component. However, with the introduction of the Hooks proposal (currently pre-released), you can now add state and effects to a Function Component. In addition, you ... more


Friday, 7 December, 2018 UTC

[Course] javascript: JavaScript Promises in Depth

[Course] javascript: JavaScript Promises in Depth

ES2015 brought a native Promise to the JavaScript standard library. In this course, we’re going to take an in-depth look at how to use promises to model various kinds of asynchronous operations. First, we’re going to explore how to create promises using ... more


Thursday, 6 December, 2018 UTC

html: Efficiently write HTML and JSX using Emmet

html: Efficiently write HTML and JSX using Emmet

Frontend developers tend to write quite a lot of HTML (or JSX). This is why it's important to be able to optimize time spent writing ` ` manually to use the cognitive resources for more challenging tasks. Modern editors such as VS Code have **emmet** ... more


Thursday, 6 December, 2018 UTC

react: Manage React component classes with classnames npm package

react: Manage React component classes with classnames npm package

When developing React apps it's common that we have components that need to have different classes depending on different conditions. In such complex scenarios, we often end up with a whole lot of `if` statements (or `switch`es) just to set proper CSS ... more


Tuesday, 4 December, 2018 UTC

[Course] javascript: Data Structures and Algorithms in JavaScript

[Course] javascript: Data Structures and Algorithms in JavaScript

This course teaches you how to implement your first data structures and algorithms. In the process, you’ll learn some fundamental computer science concepts as well. We’ll build these from scratch using JavaScript, but what we learn can be taken and used ... more


Tuesday, 4 December, 2018 UTC

[Course] react: Simplify React Apps with React Hooks

[Course] react: Simplify React Apps with React Hooks

With the massive improvements to function components in React via hooks and suspense, you may be interested in seeing how to refactor a typical class component to a simpler class component that uses React Hooks features. In this course, Kent will take ... more


Tuesday, 4 December, 2018 UTC

webpack: Bundle JavaScript Files with a Zero Config Setup using Webpack 4

webpack: Bundle JavaScript Files with a Zero Config Setup using Webpack 4

Version 4 of Webpack has a great new "zero config" mode which allows you bundle your JavaScript with, you guessed it, zero config. In this lesson you'll learn how to install Webpack and use it to bundle your code. ... more


Wednesday, 28 November, 2018 UTC

node: Execute a ClojureScript Command-line App in a Node.js Environment with Lumo

node: Execute a ClojureScript Command-line App in a Node.js Environment with Lumo

We'll use Lumo, a cross-platform standalone ClojureScript compiler and Node.js environment, to create Hello as a command-line application. In this lesson, I’ll show you how to install lumo through NPM and invoke a clojurescript function in a node environment. ... more


Wednesday, 28 November, 2018 UTC

node: Create a Simple CLI Tool in Node.js with CAC

node: Create a Simple CLI Tool in Node.js with CAC

Command-line tools can help you with all sorts of tasks. This lesson covers the very basics of setting up a CLI tool in Node.js by creating your project with npm, setting up your bin script, and using CAC to parse a single argument. ... more


Tuesday, 27 November, 2018 UTC

clojure: Compile and Run a ClojureScript Command-line App on Node.js with Lumo

clojure: Compile and Run a ClojureScript Command-line App on Node.js with Lumo

We'll use Lumo, a cross-platform standalone ClojureScript compiler and Node.js environment, to create Hello as a command-line application. In this lesson, I’ll show you how to install Lumo through NPM, invoke a function in ClojureScript, and use the println ... more


Saturday, 24 November, 2018 UTC

node: Mock a Node module's dependencies using Proxyquire

node: Mock a Node module's dependencies using Proxyquire

Sometimes when writing a unit test, you know that the module you're testing imports a module that you would like to observe, or at the very least mock to prevent side effects like network activity or file system operations. For JavaScript unit tests that ... more


Wednesday, 21 November, 2018 UTC

node: Use Experimental JavaScript Features in Node with Parcel and Babel

node: Use Experimental JavaScript Features in Node with Parcel and Babel

Sometimes when authoring code for Node you feel the need to bring in all the great features you're using writing your front-end code. Parcel comes to the rescue by easily allowing you to `target=node` and automatically compiling and preparing your JavaScript ... more


Sunday, 18 November, 2018 UTC

react: Use React.memo to avoid unnecessary re-renders in React functional components

react: Use React.memo to avoid unnecessary re-renders in React functional components

Class components can bail out from rendering when their input props are the same using `PureComponent` or `shouldComponentUpdate`. Since React 16.6 you can do the same with function components by wrapping them in [React.memo](https://reactjs.org/docs/react-api.html#reactmemo). ... more


Friday, 9 November, 2018 UTC

webpack: Support VS Code Navigation and Autocomplete Based on Webpack Aliases with jsconfig.json

webpack: Support VS Code Navigation and Autocomplete Based on Webpack Aliases with jsconfig.json

It's common to setup Webpack aliases to make imports much more convenient, but then you lose the ability to navigate and autocomplete paths in VS Code. This lesson shows you how to create a `jsconfig.json` with proper paths so you can get back to using ... more


Thursday, 8 November, 2018 UTC

[Course] npm: Execute npm Package Binaries with the npx Package Runner

[Course] npm: Execute npm Package Binaries with the npx Package Runner

You can’t be everywhere at once. Neither can node packages. But with a utility called npx — included in npm v5.2 and later — you can interact and run with node modules even if they’re not downloaded locally. The same is true for gists and remote branches ... more


Wednesday, 7 November, 2018 UTC

javascript: Destructure Nested Objects in JavaScript

javascript: Destructure Nested Objects in JavaScript

It’s commonly known that you can destructure objects in ES6, but did you know you can also destructure values from _deeply nested_ objects? In this lesson, we will cover destructuring deeply nestled objects and also providing default values in case the ... more


Wednesday, 7 November, 2018 UTC

react: Use third party components (e.g. React Select) in React Final Form

react: Use third party components (e.g. React Select) in React Final Form

No one wants to reinvent the wheel. That's why it's so important to be able to use components that someone else had created and put on npm. In this lesson we are going to learn how to use third party [React Select](https://react-select.com) in a [React ... more


Tuesday, 6 November, 2018 UTC

jquery: Animate Elements on a Webpage with jQuery

jquery: Animate Elements on a Webpage with jQuery

There are many ways of animating stuff on the Web. For example we can use CSS animations, vanilla JavaScript or jQuery library. In this lesson we are going to learn how to use jQuery `slideUp()`, `slideDown()` and `animate()` functions to animate elements ... more


Monday, 5 November, 2018 UTC

react: Cancel A Promise Using AbortController

react: Cancel A Promise Using AbortController

The AbortController interface enables us to cancel a one or more DOM requests. In this lesson, we will demonstrate how to use the controller to cancel a Javascript Promise before it is resolved. ... more


Friday, 2 November, 2018 UTC

express: Convert SVG to a PDF in Node with PDFKit and SVG.js

express: Convert SVG to a PDF in Node with PDFKit and SVG.js

I was recently given the task of generating Completion Certificates for Kent's Testing JavaScript course. We wanted the users to be able to print them at any size, so I took it upon myself to make sure that we used SVG rendered out in the PDF. This lesson ... more


Thursday, 1 November, 2018 UTC

react: Use React Fragments to wrap adjacent JSX elements without adding unnecessary wrappers

react: Use React Fragments to wrap adjacent JSX elements without adding unnecessary wrappers

In this lesson, we are going to use [React Fragments](https://reactjs.org/docs/fragments.html) to wrap adjacent JSX elements without introducing unnecessary wrapper elements to DOM. Before Fragments came along, the popular pattern was to wrap enclosing ... more


Thursday, 1 November, 2018 UTC

mocha: Mock a function's return value using a Sinon stub

mocha: Mock a function's return value using a Sinon stub

When mocking a JavaScript function during a unit test, it can be helpful to force a mock function to return a value of your choosing. This allows you to verify that functions you're testing will behave correctly for every possible use case. Much like ... more