Code examples accompanying a video series introducing working with promises by example, "A minimum of asynchronous JavaScript - Promises"

Install

Run this command to install all required libraries for the demos (as specified in ./package.json).

yarn

Database creation and population

To run the database demos you will need to:

  1. create a local database called async-demo, and then...
  2. populate it using the sql in src/dbDemo/sql/creation.sql

Running the demos

To run any demo, run the following, replacing the fake path with the path to the relevant demo

node src/path/to/demo.js

shortcuts

There are a few basic demos which have shortcuts - mostly to support me in recording videos. However, note that some of the more substantial demos are not linked here, so you will likely want to use node path/to/file as above in order to experiment with those programs.

Here's a snapshot of what they (at one point) mapped to. Look in ./package.json to be sure

Doing further experimentation

It's recommended you use this repo for your initial further experiments with enquirer, node-postgres, and axios. It is suggested you just make another directory under src/ for your code, and either start a new js file from from scratch in there, or copy into that directory one of the demo files that's relevant to your task, and then modify it to accomplish your task.