So now you've learned about XMPP connections and XMPP-FTW, and you have played with a JSON-based XMPP interface in a browser. Now let's build a very simple chat client to talk to the bot we wrote in Chapter 3, Building a One on One Chat Bot - The "Hello World" of XMPP.
First, let's create a new folder and initialize a new NPM project:
mkdir browser-chat && cd browser-chat npm init
Answer the questions however you wish (you can just happily accept all the defaults if you want). Once completed, you'll have a saved
package.json file that describes the project. As we install modules, we'll write their details into the file so that the installations can be repeated ...