A Node.js library (v1.0.2) that programmatically starts and stops a PostgreSQL Docker container from integration tests. Provides connection details (host, port, credentials) and a connection string. Released as stable with TypeScript types. Differentiates from testcontainers by being a single-purpose, minimal wrapper around Dockerode with no dependencies on test frameworks. Suitable for throwaway databases in CI or local testing.
npm install postgres-node-containerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Starts a PostgreSQL Docker container, prints the connection string, then stops the container.
Ensure Docker daemon is running and the user has permissions to interact with it.
Use Docker volumes or mount a host directory by extending the service.
Use the provided container fields to dynamically obtain the port.
Ensure Docker is running and await the setup promise completely. The host defaults to 'localhost' but may differ in CI environments.
Always await setupPostgresContainer() and access properties from the resolved container object.