https://github.com/justjavac/deno-is
Detect the running environment and context of the current script
https://github.com/justjavac/deno-is
check cli deno env mod typescript
Last synced: about 1 month ago
JSON representation
Detect the running environment and context of the current script
- Host: GitHub
- URL: https://github.com/justjavac/deno-is
- Owner: justjavac
- License: mit
- Created: 2019-08-29T08:29:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T08:31:09.000Z (about 4 years ago)
- Last Synced: 2024-10-03T11:41:46.519Z (8 months ago)
- Topics: check, cli, deno, env, mod, typescript
- Language: TypeScript
- Homepage:
- Size: 32.2 KB
- Stars: 21
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-is
[](https://github.com/justjavac/deno-is/releases)
[](https://github.com/justjavac/deno-is/actions)
[](https://github.com/justjavac/deno-is/blob/master/LICENSE)
[](https://github.com/denoland/deno)> Detect the running environment and context of the current script.
## Usage
```ts
import { isRunning, isRunningSync, isCI, isCISync } from "https://deno.land/x/is/mod.ts";isCISync();
// => false
isRunningSync(Deno.pid);
// => trueawait isCI();
// => false
await isRunning(Deno.pid);
// => true```
or
```ts
import { isCI, isCISync } from "https://deno.land/x/is/ci.ts";isCISync();
// => falseawait 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][1] |[1]: https://msdn.microsoft.com/commandline/wsl/about
### Credits
- [justjavac](https://github.com/justjavac)
### License
[deno-is](https://github.com/justjavac/deno-is) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.