@noodleseed/one 0.62.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +8 -2
- package/dist/bin.js.map +1 -1
- package/dist/browser.d.ts +10 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +18 -0
- package/dist/browser.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/apps-ops.js +1 -1
- package/dist/commands/apps-ops.js.map +1 -1
- package/dist/commands/deploy-ops.d.ts +2 -3
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +5 -17
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/github-ops.d.ts +3 -2
- package/dist/commands/github-ops.d.ts.map +1 -1
- package/dist/commands/github-ops.js +7 -4
- package/dist/commands/github-ops.js.map +1 -1
- package/dist/control-plane.d.ts +2 -1
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +31 -10
- package/dist/control-plane.js.map +1 -1
- package/dist/device-login.d.ts +30 -0
- package/dist/device-login.d.ts.map +1 -0
- package/dist/device-login.js +162 -0
- package/dist/device-login.js.map +1 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +11 -0
- package/dist/doctor.js.map +1 -1
- package/dist/platform-support.d.ts +22 -0
- package/dist/platform-support.d.ts.map +1 -0
- package/dist/platform-support.js +118 -0
- package/dist/platform-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.js +65 -0
- package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/branding.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/oauth/branding.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/branding.js +3 -2
- package/node_modules/@noodle-borg/service/dist/oauth/branding.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js +216 -28
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/device-flow.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-flow.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-flow.js +239 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-flow.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-provider.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-provider.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-provider.js +45 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-provider.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.js +33 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.d.ts +30 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.js +31 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store.d.ts +66 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store.js +2 -0
- package/node_modules/@noodle-borg/service/dist/oauth/device-store.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/paths.js +3 -0
- package/node_modules/@noodle-borg/service/dist/oauth/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js +36 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +14 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +122 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +15 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store.js +83 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
- package/node_modules/bundle-name/index.js +5 -0
- package/node_modules/bundle-name/license +9 -0
- package/node_modules/bundle-name/package.json +45 -0
- package/node_modules/bundle-name/readme.md +23 -0
- package/node_modules/default-browser/index.d.ts +29 -0
- package/node_modules/default-browser/index.js +34 -0
- package/node_modules/default-browser/license +9 -0
- package/node_modules/default-browser/package.json +54 -0
- package/node_modules/default-browser/readme.md +24 -0
- package/node_modules/default-browser/windows.js +57 -0
- package/node_modules/default-browser-id/index.js +25 -0
- package/node_modules/default-browser-id/license +9 -0
- package/node_modules/default-browser-id/package.json +41 -0
- package/node_modules/default-browser-id/readme.md +19 -0
- package/node_modules/define-lazy-prop/index.d.ts +31 -0
- package/node_modules/define-lazy-prop/index.js +18 -0
- package/node_modules/define-lazy-prop/license +9 -0
- package/node_modules/define-lazy-prop/package.json +51 -0
- package/node_modules/define-lazy-prop/readme.md +55 -0
- package/node_modules/is-docker/cli.js +5 -0
- package/node_modules/is-docker/index.d.ts +13 -0
- package/node_modules/is-docker/index.js +29 -0
- package/node_modules/is-docker/license +9 -0
- package/node_modules/is-docker/package.json +44 -0
- package/node_modules/is-docker/readme.md +27 -0
- package/node_modules/is-in-ssh/index.d.ts +15 -0
- package/node_modules/is-in-ssh/index.js +7 -0
- package/node_modules/is-in-ssh/license +9 -0
- package/node_modules/is-in-ssh/package.json +43 -0
- package/node_modules/is-in-ssh/readme.md +43 -0
- package/node_modules/is-inside-container/cli.js +5 -0
- package/node_modules/is-inside-container/index.d.ts +13 -0
- package/node_modules/is-inside-container/index.js +23 -0
- package/node_modules/is-inside-container/license +9 -0
- package/node_modules/is-inside-container/package.json +51 -0
- package/node_modules/is-inside-container/readme.md +36 -0
- package/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/is-wsl/index.js +36 -0
- package/node_modules/is-wsl/license +9 -0
- package/node_modules/is-wsl/package.json +58 -0
- package/node_modules/is-wsl/readme.md +21 -0
- package/node_modules/open/index.d.ts +158 -0
- package/node_modules/open/index.js +417 -0
- package/node_modules/open/license +9 -0
- package/node_modules/open/package.json +70 -0
- package/node_modules/open/readme.md +197 -0
- package/node_modules/open/xdg-open +1267 -0
- package/node_modules/powershell-utils/index.d.ts +122 -0
- package/node_modules/powershell-utils/index.js +58 -0
- package/node_modules/powershell-utils/license +9 -0
- package/node_modules/powershell-utils/package.json +47 -0
- package/node_modules/powershell-utils/readme.md +153 -0
- package/node_modules/run-applescript/index.d.ts +66 -0
- package/node_modules/run-applescript/index.js +37 -0
- package/node_modules/run-applescript/license +9 -0
- package/node_modules/run-applescript/package.json +42 -0
- package/node_modules/run-applescript/readme.md +78 -0
- package/node_modules/wsl-utils/index.d.ts +81 -0
- package/node_modules/wsl-utils/index.js +98 -0
- package/node_modules/wsl-utils/license +9 -0
- package/node_modules/wsl-utils/package.json +48 -0
- package/node_modules/wsl-utils/readme.md +111 -0
- package/node_modules/wsl-utils/utilities.js +19 -0
- package/package.json +14 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
|
|
3
|
+
let isDockerCached;
|
|
4
|
+
|
|
5
|
+
function hasDockerEnv() {
|
|
6
|
+
try {
|
|
7
|
+
fs.statSync('/.dockerenv');
|
|
8
|
+
return true;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function hasDockerCGroup() {
|
|
15
|
+
try {
|
|
16
|
+
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function isDocker() {
|
|
23
|
+
// TODO: Use `??=` when targeting Node.js 16.
|
|
24
|
+
if (isDockerCached === undefined) {
|
|
25
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return isDockerCached;
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "is-docker",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Check if the process is running inside a Docker container",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/is-docker",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.js",
|
|
15
|
+
"bin": "./cli.js",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "xo && ava && tsd"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js",
|
|
24
|
+
"index.d.ts",
|
|
25
|
+
"cli.js"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"detect",
|
|
29
|
+
"docker",
|
|
30
|
+
"dockerized",
|
|
31
|
+
"container",
|
|
32
|
+
"inside",
|
|
33
|
+
"is",
|
|
34
|
+
"env",
|
|
35
|
+
"environment",
|
|
36
|
+
"process"
|
|
37
|
+
],
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"ava": "^3.15.0",
|
|
40
|
+
"sinon": "^11.1.2",
|
|
41
|
+
"tsd": "^0.17.0",
|
|
42
|
+
"xo": "^0.44.0"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# is-docker
|
|
2
|
+
|
|
3
|
+
> Check if the process is running inside a Docker container
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ npm install is-docker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import isDocker from 'is-docker';
|
|
15
|
+
|
|
16
|
+
if (isDocker()) {
|
|
17
|
+
console.log('Running inside a Docker container');
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## CLI
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
$ is-docker
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Exits with code 0 if inside a Docker container and 2 if not.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Check if the process is running in an SSH session.
|
|
3
|
+
|
|
4
|
+
@example
|
|
5
|
+
```
|
|
6
|
+
import isInSsh from 'is-in-ssh';
|
|
7
|
+
|
|
8
|
+
if (isInSsh) {
|
|
9
|
+
console.log('Running in an SSH session');
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
*/
|
|
13
|
+
declare const isInSsh: boolean;
|
|
14
|
+
|
|
15
|
+
export default isInSsh;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "is-in-ssh",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Check if the process is running in an SSH session",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/is-in-ssh",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "xo && node --test"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"index.js",
|
|
27
|
+
"index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"ssh",
|
|
31
|
+
"detect",
|
|
32
|
+
"detection",
|
|
33
|
+
"session",
|
|
34
|
+
"remote",
|
|
35
|
+
"connection",
|
|
36
|
+
"environment",
|
|
37
|
+
"check",
|
|
38
|
+
"is"
|
|
39
|
+
],
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"xo": "^1.2.3"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# is-in-ssh
|
|
2
|
+
|
|
3
|
+
> Check if the process is running in an SSH session
|
|
4
|
+
|
|
5
|
+
Useful for determining if your Node.js process is being executed over SSH, which can affect how you handle operations like opening files, browsers, or using system-specific commands.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install is-in-ssh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import isInSsh from 'is-in-ssh';
|
|
17
|
+
|
|
18
|
+
if (isInSsh) {
|
|
19
|
+
console.log('Running in an SSH session');
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## How it works
|
|
24
|
+
|
|
25
|
+
The package detects SSH sessions by checking for the presence of standard SSH environment variables:
|
|
26
|
+
|
|
27
|
+
- `SSH_CONNECTION`
|
|
28
|
+
- `SSH_CLIENT`
|
|
29
|
+
- `SSH_TTY`
|
|
30
|
+
|
|
31
|
+
These variables are automatically set by SSH servers when establishing a connection.
|
|
32
|
+
|
|
33
|
+
## Limitations
|
|
34
|
+
|
|
35
|
+
- The detection relies on environment variables, which could theoretically be spoofed or cleared
|
|
36
|
+
- May return `true` for `ssh localhost` connections (which are technically SSH sessions)
|
|
37
|
+
- Environment variables might not be inherited by all child processes or after privilege escalation (e.g., `sudo`)
|
|
38
|
+
|
|
39
|
+
## Related
|
|
40
|
+
|
|
41
|
+
- [is-wsl](https://github.com/sindresorhus/is-wsl) - Check if the process is running inside Windows Subsystem for Linux
|
|
42
|
+
- [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container
|
|
43
|
+
- [is-inside-container](https://github.com/sindresorhus/is-inside-container) - Check if the process is running inside a container
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Check if the process is running inside a container.
|
|
3
|
+
|
|
4
|
+
@example
|
|
5
|
+
```
|
|
6
|
+
import isInsideContainer from 'is-inside-container';
|
|
7
|
+
|
|
8
|
+
if (isInsideContainer()) {
|
|
9
|
+
console.log('Running inside a container');
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
*/
|
|
13
|
+
export default function isInsideContainer(): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import isDocker from 'is-docker';
|
|
3
|
+
|
|
4
|
+
let cachedResult;
|
|
5
|
+
|
|
6
|
+
// Podman detection
|
|
7
|
+
const hasContainerEnv = () => {
|
|
8
|
+
try {
|
|
9
|
+
fs.statSync('/run/.containerenv');
|
|
10
|
+
return true;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default function isInsideContainer() {
|
|
17
|
+
// TODO: Use `??=` when targeting Node.js 16.
|
|
18
|
+
if (cachedResult === undefined) {
|
|
19
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return cachedResult;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "is-inside-container",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Check if the process is running inside a container (Docker/Podman)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/is-inside-container",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"bin": "./cli.js",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=14.16"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "xo && NODE_OPTIONS='--loader=esmock --no-warnings' ava && tsd"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"index.js",
|
|
27
|
+
"index.d.ts",
|
|
28
|
+
"cli.js"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"detect",
|
|
32
|
+
"inside",
|
|
33
|
+
"container",
|
|
34
|
+
"docker",
|
|
35
|
+
"dockerized",
|
|
36
|
+
"podman",
|
|
37
|
+
"is",
|
|
38
|
+
"env",
|
|
39
|
+
"environment",
|
|
40
|
+
"process"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"is-docker": "^3.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"ava": "^5.2.0",
|
|
47
|
+
"esmock": "^2.1.0",
|
|
48
|
+
"tsd": "^0.25.0",
|
|
49
|
+
"xo": "^0.53.1"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# is-inside-container
|
|
2
|
+
|
|
3
|
+
> Check if the process is running inside a container
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install is-inside-container
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import isInsideContainer from 'is-inside-container';
|
|
15
|
+
|
|
16
|
+
if (isInsideContainer()) {
|
|
17
|
+
console.log('Running inside a container');
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## CLI
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
is-inside-container
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Exits with code 0 if inside a container and 2 if not.
|
|
28
|
+
|
|
29
|
+
## Supported containers
|
|
30
|
+
|
|
31
|
+
- Docker
|
|
32
|
+
- Podman
|
|
33
|
+
|
|
34
|
+
## Related
|
|
35
|
+
|
|
36
|
+
- [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (Bash on Windows).
|
|
3
|
+
|
|
4
|
+
@example
|
|
5
|
+
```
|
|
6
|
+
import isWsl from 'is-wsl';
|
|
7
|
+
|
|
8
|
+
// When running inside Windows Subsystem for Linux
|
|
9
|
+
console.log(isWsl);
|
|
10
|
+
//=> true
|
|
11
|
+
```
|
|
12
|
+
*/
|
|
13
|
+
declare const isWsl: boolean;
|
|
14
|
+
|
|
15
|
+
export default isWsl;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import isInsideContainer from 'is-inside-container';
|
|
5
|
+
|
|
6
|
+
const isWsl = () => {
|
|
7
|
+
if (process.platform !== 'linux') {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (os.release().toLowerCase().includes('microsoft')) {
|
|
12
|
+
if (isInsideContainer()) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
if (fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) {
|
|
21
|
+
return !isInsideContainer();
|
|
22
|
+
}
|
|
23
|
+
} catch {}
|
|
24
|
+
|
|
25
|
+
// Fallback for custom kernels: check WSL-specific paths.
|
|
26
|
+
if (
|
|
27
|
+
fs.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop')
|
|
28
|
+
|| fs.existsSync('/run/WSL')
|
|
29
|
+
) {
|
|
30
|
+
return !isInsideContainer();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "is-wsl",
|
|
3
|
+
"version": "3.1.1",
|
|
4
|
+
"description": "Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/is-wsl",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "xo && ava && tsd"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"index.js",
|
|
27
|
+
"index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"check",
|
|
31
|
+
"wsl",
|
|
32
|
+
"windows",
|
|
33
|
+
"subsystem",
|
|
34
|
+
"linux",
|
|
35
|
+
"detect",
|
|
36
|
+
"bash",
|
|
37
|
+
"process",
|
|
38
|
+
"console",
|
|
39
|
+
"terminal",
|
|
40
|
+
"is"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"is-inside-container": "^1.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"ava": "^5.3.1",
|
|
47
|
+
"esmock": "^2.3.6",
|
|
48
|
+
"tsd": "^0.28.1",
|
|
49
|
+
"xo": "^0.55.1"
|
|
50
|
+
},
|
|
51
|
+
"ava": {
|
|
52
|
+
"serial": true,
|
|
53
|
+
"nodeArguments": [
|
|
54
|
+
"--loader=esmock",
|
|
55
|
+
"--no-warnings"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# is-wsl
|
|
2
|
+
|
|
3
|
+
> Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (Bash on Windows)
|
|
4
|
+
|
|
5
|
+
Can be useful if you need to work around unimplemented or buggy features in WSL. Supports both WSL 1 and WSL 2.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install is-wsl
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import isWsl from 'is-wsl';
|
|
17
|
+
|
|
18
|
+
// When running inside Windows Subsystem for Linux
|
|
19
|
+
console.log(isWsl);
|
|
20
|
+
//=> true
|
|
21
|
+
```
|