Node bindings for Libvirt
The bindings are generated from libvirt's exported api
Experimental. This library is still under active development and subject to non-backwards compatible changes in any future version. Use of this library is not recommended in production environments until version 1.0.0 is released.
- libvirt-dev must be installed and in your include path
- Node version that supports napi >= 8
- gcc installed
Install libvirt-node through npm
sudo apt-get install libvirt-dev
npm install libvirt-node
const libvirt = require('libvirt-node');
let connection = libvirt.open('qemu:///system');
let domains = connection.listAllDomains(libvirt.VIR_CONNECT_LIST_DOMAINS_RUNNING);
console.log(`My running domains: ${domains.map(domain => domain.getName())}`);
More examples can be found in the tests
libvirt-node loosly mirrors the official libvirt docs with minor corrections (mainly without the virModule prefix)
The API is still under development and not all libvirt functions are supported.
The whitelist has the supported (and not yet supported) functions.
For development documentation please refer to DEVELOPMENT.md
If you already installed docker locally, you can check build by
make docker
libvirt-node is released under LGPL-2.1