download
raw
431 Bytes
import fs from 'node:fs';
import isDocker from 'is-docker';
let cachedResult;
// Podman detection
const hasContainerEnv = () => {
try {
fs.statSync('/run/.containerenv');
return true;
} catch {
return false;
}
};
export default function isInsideContainer() {
// TODO: Use `??=` when targeting Node.js 16.
if (cachedResult === undefined) {
cachedResult = hasContainerEnv() || isDocker();
}
return cachedResult;
}

Xet Storage Details

Size:
431 Bytes
·
Xet hash:
32a955f9e38a6381f3c343f4d6ec76ac3b12ac843d03e7d9242cc349526bbc19

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.