concept command - line app in category data

appears as: commd-line app, command-line app, commd-line apps
Data Wrangling with JavaScript

This is an excerpt from Manning's book Data Wrangling with JavaScript.

Let’s consider what we’ll build in this chapter. First, we’ll create a command-line application that produces a report based on data (figure 2.1). We’re keeping things simple, so the data will be hard-coded into the script, and the “report” will be simple command-line output. After the command-line app, we’ll create a web server that hosts a REST API. The server will host a simple web page that retrieves a report from the web server and displays it in the browser (figure 2.2).

Listing 2.5 General pattern for a command-line app
"use strict";

const yargs = require('yargs');
const argv = yargs.argv;    #1  
const assert = require('chai').assert;    #2  

//
// App specific module imports here.
//

//
// Argument checking and preprocessing here.
//

//
// Implement the code for the app here.
//

#1   Uses yargs for access to command-line arguments
#2   Uses chai for its assert library for validation