Node.js wrapper for the Docker CLI that executes docker commands via child_process.exec, returning parsed output (raw, success, imageId, etc.) as a promise. Current stable version is 2.10.0 with TypeScript types included. Maintained by Quobject, the library wraps the Docker CLI tool — not the Docker SDK — and supports custom machines, working directories, and echo output. Useful for scripting Docker operations from Node without the Docker SDK, but inherently couples to the CLI availability and command syntax.
npm install docker-cli-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates async/await usage of dockerCommand with default options to list containers.
Sanitize or whitelist command parts; do not pass unsanitized user input.
Use DockerOptions instead of Options, or import Options as alias.
Use .then() or async/await; no longer supports callbacks.
Use DockerOptions.
Ensure Docker is accessible or set machineName to a valid machine.
Install Docker and ensure it's accessible from terminal.
Pass options with env as an object of key-value pairs, not an array.
Run `npm install docker-cli-js` and use correct import as shown in imports section.