O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

The steps for the recipe are as follows:

  1. 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
  1. 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"); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required