podstack
v0.1.1
Published
A Podman-native TypeScript SDK for Node.js.
Maintainers
Readme
podstack
A Podman-native TypeScript SDK for Node.js.
podstack talks directly to the Podman REST API through an HTTP endpoint or a
Unix socket. It has no runtime dependencies and ships TypeScript declarations.
Install
npm install podstackUsage
import { createPodmanClient } from "podstack";
const podman = createPodmanClient({
socketPath: "/run/user/1000/podman/podman.sock"
});
const version = await podman.system.version();
const containers = await podman.containers.list({
query: { all: true }
});
console.log(version.Version);
console.log(containers);You can also connect to a Podman service over HTTP:
import { createPodmanClient } from "podstack";
const podman = createPodmanClient({
baseUrl: "http://localhost:8080"
});Development
npm install
npm run generate
npm run check
npm testSDK surface
The SDK is generated from openapi/swagger-latest.yaml and covers all Podman
routes in that file. Libpod routes are exposed through resource groups such as
podman.containers, podman.images, podman.pods, podman.networks, and
podman.system.
Docker-compatible routes are available under podman.compat, for example:
await podman.compat.containers.list({
query: { all: true }
});Generated methods accept a consistent operation input:
await podman.containers.start({
path: { name: "demo" },
query: { detachKeys: "ctrl-p,ctrl-q" }
});Use podman.request() for direct low-level calls or for endpoints that need
custom handling.
