Skip to content
Detect the running environment and context of the current script
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode init commit Aug 29, 2019
test
.gitignore
.travis.yml init commit Aug 29, 2019
CHANGELOG.md
LICENSE
README.md
ci.ts add async and sync Sep 2, 2019
docker.ts add async and sync Sep 2, 2019
gzip.ts
mod.ts
running.ts add async and sync Sep 2, 2019
ssh.ts
util.ts add isSSH Sep 2, 2019
wsl.ts

README.md

deno-is

Build Status

Detect the running environment and context of the current script.

Usage

import { isRunning, isRunningSync, isCI, isCISync } from "https://deno.land/x/is/mod.ts";

isCISync();
// => false
isRunningSync(Deno.pid);
// => true

await isCI();
// => false
await isRunning(Deno.pid);
// => true

or

import { isCI, isCISync } from "https://deno.land/x/is/ci.ts";

isCISync();
// => false

await isCI();
// => false

Available methods

alphabetical order:

Methods Description
isCI/isCISync Whether the process is running on the CI server
isDocker/isDockerSync Whether the process is running inside Docker
isGzip/isGzipSync Whether a Uint8Array is a gzip file
isRunning/isRunningSync Whether the process(pid) is running
isSSH/isSSHSync Whether the process is running inside SSH
isWsl/isWslSync Whether the process is running inside Windows Subsystem for Linux

Credits

License

deno-is is released under the MIT License. See the bundled LICENSE file for details.

You can’t perform that action at this time.