# testcontainers/testcontainers-node

Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Repository: https://github.com/testcontainers/testcontainers-node
Canonical: https://ross.abutalabs.com/products/testcontainers-node
Homepage: https://testcontainers.com
Language: TypeScript
License: MIT
License Family: permissive
Topics: node, docker, testcontainers, testing
Last push: 2026-08-24T00:47:16+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 96, longevity 100
- inputs: {"age_days": 3162, "days_push": 10, "days_rel": 29, "gap_med": 9, "n_releases_24m": 52}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2592, forks 266 (observed 2026-08-28T04:07:02.974110+00:00)

## What it is
Testcontainers for Node.js is a TypeScript library that spins up lightweight, throwaway Docker containers of real dependencies like databases, message brokers, and web browsers for use in tests. It provides a programmatic API to start and stop containers from test code, replacing mocks and in-memory services with real services.

## Use cases
- spin up a throwaway postgres container for integration tests in node
- run tests against real redis instead of mocks
- start selenium browser containers for e2e tests
- bootstrap local dev dependencies with docker from code
- replace in-memory databases with real services in CI
- test database repository code against a real database

## When to choose
- you write Node.js integration tests that need real databases, brokers, or browsers
- you want deterministic, isolated test infrastructure without shared state
- you want to avoid mocks and in-memory fakes that diverge from production behavior

## When to avoid
- your environment has no Docker available
- you only need fast unit tests with no external dependencies
- you need containers managed outside the test lifecycle

## Facets
- artifact type: library
- maturity: active
- function: testing, e2e-testing, container-runtime, developer-tools
- domain: testing, developer-tools, databases
- platform: cross-platform
- tags: testcontainers, integration-testing, docker, throwaway-containers, test-dependencies, containers, nodejs

## Member repositories
- testcontainers/testcontainers-node (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:02.974110+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:22:17.992704+00:00, confidence not recorded.
  - readme: https://github.com/testcontainers/testcontainers-node (fetched 2026-08-28T04:07:02.974110+00:00, sha ff1d2ecc9907)
  - homepage: https://testcontainers.com (fetched 2026-08-29T10:04:51.427243+00:00, sha 9e8ecc1112b8)
  - site_page: https://testcontainers.com/getting-started (fetched 2026-08-29T10:04:51.430634+00:00, sha 5d1bff396e32)
  - site_page: https://testcontainers.com/guides/getting-started-with-testcontainers-for-java (fetched 2026-08-29T10:04:51.433775+00:00, sha 5ed6e2fb39fd)
  - site_page: https://testcontainers.com/guides/getting-started-with-testcontainers-for-go (fetched 2026-08-29T10:04:51.435958+00:00, sha 04b5ff0e4bfc)
  - site_page: https://testcontainers.com/guides/getting-started-with-testcontainers-for-dotnet (fetched 2026-08-29T10:04:51.438069+00:00, sha cb0404881f62)
  - site_page: https://testcontainers.com/guides/getting-started-with-testcontainers-for-nodejs (fetched 2026-08-29T10:04:51.440580+00:00, sha b5585c2d107d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
