Cisco DevNet & jsxapi GitHub Repository (Official Vendor Documentation): The official jsxapi documentation demonstrates the standard usage pattern.
Connecting: The README.md shows the proper way to import and initialize the library is const xapi = require('jsxapi');. (URL: https://github.com/cisco-js/jsxapi, Section: "Usage")
Executing Commands: The documentation explicitly states that to send a command, you use the xapi.command(path, params) method, which returns a promise. (URL: https://github.com/cisco-js/jsxapi, Section: "API > xapi.command(path, params)")
Promise Handling: The examples show the use of .then() for success and .catch() for handling errors, which is the standard for JavaScript Promises. (URL: https://github.com/cisco-js/jsxapi, Section: "API > xapi.command(path, params)")