postgres-container is a lightweight Node.js module (v0.0.2) that programmatically starts a PostgreSQL Docker container, primarily designed for integration tests. It simplifies test setup by managing container lifecycle (start/stop) and connection details. Unlike heavy test frameworks or manual Docker commands, it offers a minimal API with zero external runtime dependencies beyond Docker. Note: version 0.0.2 is very early; API stability is not guaranteed.
npm install postgres-containerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to start a Postgres Docker container for integration tests, configuring image, port, credentials, and database name.
Ensure Docker is available and that the current user has permission to run Docker commands.
Pin to exact version and test upgrades carefully.
Use container.stop() which should remove the container. Verify with `docker ps -a`.
Use import instead: 'import postgresContainer from "postgres-container"'
Start Docker and ensure the current user has permission to run Docker (e.g., add to docker group).
Specify a different port in the configuration object: port: 5433
No dependency data recorded yet.