The steps for the recipe are as follows:
- First of all, download two external dependencies that we require for the application, namely getpass—in order to read a password silently from the terminal, and argparse which is a convenient command-line parsing module that operates in an almost identical way to the Python built-in module of the same name. In your application source directly, use npm to install the two modules:
unix$ npm install argparse unix$ npm install getpass
- Start the Node.js app source code with the usual boilerplate which defines the interpreter and imports the necessary modules:
#!/usr/bin/env node const https = require("https"); const fs = require("fs"); const os = require("os"); const argparse = require("argparse"); ...