is-docker
npmv4.0.0TypeScriptCheck if the process is running inside a Docker container
Safe to adopt
Yes — is-docker scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 359 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 359 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 3.4 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding is-docker to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=20
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the is-docker README.
import isDocker from 'is-docker';
if (isDocker()) {
console.log('Running inside a Docker container');
}is-docker vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| is-dockerthis page | 0 | 2 | MIT | 11 months ago |
| is-inside-container | 0 | 2 | MIT | 1 day ago |
| is-wsl | 117.6M | 4 | MIT | 1 day ago |
| is-in-ssh | 0 | 1 | MIT | 1 day ago |
| path-key | 244.9M | 1 | MIT | 1 day ago |
| has-flag | 166.9M | 1 | MIT | 1 day ago |
Dependencies
Declared by is-docker v4.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (2)
Used by
Popular packages that depend on is-docker.
Relationship graph
Dependencies (left) and dependents (right) of is-docker.
Frequently installed together
A stand-alone types package for Undici
An HTTP(s) proxy `http.Agent` implementation for HTTPS
A light-weight module that brings Fetch API to node.js
Fast, unopinionated, minimalist web framework
Node.js CORS middleware
Port of jQuery.extend for node.js and the browser
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
TypeScript definitions for node
TypeScript definitions for cors
Release history
1 release in the last two years, typically about 244 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.0.0latest | 11 months ago | 3.4 KB | MIT |
| 3.0.0 | 5 years ago | 3.1 KB | MIT |
| 2.2.1 | 5 years ago | 2.9 KB | MIT |
| 2.2.0 | 5 years ago | 3.1 KB | MIT |
| 2.1.1 | 6 years ago | 3.1 KB | MIT |
| 2.1.0 | 6 years ago | 3.1 KB | MIT |
| 2.0.0 | 7 years ago | 2.8 KB | MIT |
| 1.1.0 | 10 years ago | — | MIT |
| 1.0.1 | 10 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
Overview
is-docker is an npm package that check if the process is running inside a Docker container. It has 2 known dependents in the graph. The latest version is 4.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need check if the process is running inside a Docker container and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (2 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use is-docker?
Yes — is-docker scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 359 days ago.
How do I install is-docker?
Run `npm install is-docker` to add is-docker to your npm project.
What license is is-docker released under?
is-docker is distributed under the MIT license.
How popular is is-docker?
npm does not publish download counts. Within PackageGraph's crawl, 2 known packages depend on is-docker.
Is is-docker still maintained?
The most recent release of is-docker (v4.0.0) was published 11 months ago.
Does is-docker run install scripts?
No. is-docker does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.