@noodleseed/one 0.61.0 → 0.63.0

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.
Files changed (188) hide show
  1. package/dist/bin.js +8 -2
  2. package/dist/bin.js.map +1 -1
  3. package/dist/browser.d.ts +10 -0
  4. package/dist/browser.d.ts.map +1 -0
  5. package/dist/browser.js +18 -0
  6. package/dist/browser.js.map +1 -0
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +4 -0
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/apps-ops.js +1 -1
  11. package/dist/commands/apps-ops.js.map +1 -1
  12. package/dist/commands/deploy-ops.d.ts +2 -3
  13. package/dist/commands/deploy-ops.d.ts.map +1 -1
  14. package/dist/commands/deploy-ops.js +5 -17
  15. package/dist/commands/deploy-ops.js.map +1 -1
  16. package/dist/commands/github-ops.d.ts +3 -2
  17. package/dist/commands/github-ops.d.ts.map +1 -1
  18. package/dist/commands/github-ops.js +7 -4
  19. package/dist/commands/github-ops.js.map +1 -1
  20. package/dist/control-plane.d.ts +2 -1
  21. package/dist/control-plane.d.ts.map +1 -1
  22. package/dist/control-plane.js +31 -10
  23. package/dist/control-plane.js.map +1 -1
  24. package/dist/device-login.d.ts +30 -0
  25. package/dist/device-login.d.ts.map +1 -0
  26. package/dist/device-login.js +162 -0
  27. package/dist/device-login.js.map +1 -0
  28. package/dist/doctor.d.ts.map +1 -1
  29. package/dist/doctor.js +11 -0
  30. package/dist/doctor.js.map +1 -1
  31. package/dist/platform-support.d.ts +22 -0
  32. package/dist/platform-support.d.ts.map +1 -0
  33. package/dist/platform-support.js +118 -0
  34. package/dist/platform-support.js.map +1 -0
  35. package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.d.ts.map +1 -1
  36. package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js +2 -0
  37. package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js.map +1 -1
  38. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-schema.d.ts +4 -0
  39. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-schema.d.ts.map +1 -0
  40. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-schema.js +74 -0
  41. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-schema.js.map +1 -0
  42. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-store.d.ts +31 -0
  43. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-store.d.ts.map +1 -0
  44. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-store.js +295 -0
  45. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-overage-store.js.map +1 -0
  46. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-schema.d.ts.map +1 -1
  47. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-schema.js +13 -0
  48. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-schema.js.map +1 -1
  49. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-store.d.ts.map +1 -1
  50. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-store.js +4 -0
  51. package/node_modules/@noodle-borg/service/dist/billing/postgres-stripe-store.js.map +1 -1
  52. package/node_modules/@noodle-borg/service/dist/billing/stripe-config.d.ts +1 -0
  53. package/node_modules/@noodle-borg/service/dist/billing/stripe-config.d.ts.map +1 -1
  54. package/node_modules/@noodle-borg/service/dist/billing/stripe-config.js +12 -1
  55. package/node_modules/@noodle-borg/service/dist/billing/stripe-config.js.map +1 -1
  56. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration-loader.d.ts +7 -0
  57. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration-loader.d.ts.map +1 -1
  58. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration-loader.js +14 -0
  59. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration-loader.js.map +1 -1
  60. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration.d.ts +7 -0
  61. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration.d.ts.map +1 -1
  62. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration.js +38 -0
  63. package/node_modules/@noodle-borg/service/dist/billing/stripe-integration.js.map +1 -1
  64. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider-validation.d.ts +49 -0
  65. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider-validation.d.ts.map +1 -0
  66. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider-validation.js +241 -0
  67. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider-validation.js.map +1 -0
  68. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider.d.ts +28 -0
  69. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider.d.ts.map +1 -0
  70. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider.js +133 -0
  71. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-provider.js.map +1 -0
  72. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-service.d.ts +23 -0
  73. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-service.d.ts.map +1 -0
  74. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-service.js +171 -0
  75. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-service.js.map +1 -0
  76. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-store.d.ts +51 -0
  77. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-store.d.ts.map +1 -0
  78. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-store.js +2 -0
  79. package/node_modules/@noodle-borg/service/dist/billing/stripe-overage-store.js.map +1 -0
  80. package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
  81. package/node_modules/@noodle-borg/service/dist/oauth/app.js +65 -0
  82. package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
  83. package/node_modules/@noodle-borg/service/dist/oauth/device-flow.d.ts +20 -0
  84. package/node_modules/@noodle-borg/service/dist/oauth/device-flow.d.ts.map +1 -0
  85. package/node_modules/@noodle-borg/service/dist/oauth/device-flow.js +239 -0
  86. package/node_modules/@noodle-borg/service/dist/oauth/device-flow.js.map +1 -0
  87. package/node_modules/@noodle-borg/service/dist/oauth/device-provider.d.ts +15 -0
  88. package/node_modules/@noodle-borg/service/dist/oauth/device-provider.d.ts.map +1 -0
  89. package/node_modules/@noodle-borg/service/dist/oauth/device-provider.js +45 -0
  90. package/node_modules/@noodle-borg/service/dist/oauth/device-provider.js.map +1 -0
  91. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.d.ts +3 -0
  92. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.d.ts.map +1 -0
  93. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.js +33 -0
  94. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-schema.js.map +1 -0
  95. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.d.ts +30 -0
  96. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.d.ts.map +1 -0
  97. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.js +31 -0
  98. package/node_modules/@noodle-borg/service/dist/oauth/device-store-postgres-types.js.map +1 -0
  99. package/node_modules/@noodle-borg/service/dist/oauth/device-store.d.ts +66 -0
  100. package/node_modules/@noodle-borg/service/dist/oauth/device-store.d.ts.map +1 -0
  101. package/node_modules/@noodle-borg/service/dist/oauth/device-store.js +2 -0
  102. package/node_modules/@noodle-borg/service/dist/oauth/device-store.js.map +1 -0
  103. package/node_modules/@noodle-borg/service/dist/oauth/paths.d.ts.map +1 -1
  104. package/node_modules/@noodle-borg/service/dist/oauth/paths.js +3 -0
  105. package/node_modules/@noodle-borg/service/dist/oauth/paths.js.map +1 -1
  106. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts +7 -0
  107. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  108. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +36 -1
  109. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  110. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +14 -0
  111. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
  112. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +122 -0
  113. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
  114. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +15 -1
  115. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
  116. package/node_modules/@noodle-borg/service/dist/oauth/store.js +83 -0
  117. package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
  118. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  119. package/node_modules/@noodle-borg/service/dist/serve.js +14 -1
  120. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  121. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts +1 -0
  122. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts.map +1 -1
  123. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +3 -0
  124. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js.map +1 -1
  125. package/node_modules/bundle-name/index.js +5 -0
  126. package/node_modules/bundle-name/license +9 -0
  127. package/node_modules/bundle-name/package.json +45 -0
  128. package/node_modules/bundle-name/readme.md +23 -0
  129. package/node_modules/default-browser/index.d.ts +29 -0
  130. package/node_modules/default-browser/index.js +34 -0
  131. package/node_modules/default-browser/license +9 -0
  132. package/node_modules/default-browser/package.json +54 -0
  133. package/node_modules/default-browser/readme.md +24 -0
  134. package/node_modules/default-browser/windows.js +57 -0
  135. package/node_modules/default-browser-id/index.js +25 -0
  136. package/node_modules/default-browser-id/license +9 -0
  137. package/node_modules/default-browser-id/package.json +41 -0
  138. package/node_modules/default-browser-id/readme.md +19 -0
  139. package/node_modules/define-lazy-prop/index.d.ts +31 -0
  140. package/node_modules/define-lazy-prop/index.js +18 -0
  141. package/node_modules/define-lazy-prop/license +9 -0
  142. package/node_modules/define-lazy-prop/package.json +51 -0
  143. package/node_modules/define-lazy-prop/readme.md +55 -0
  144. package/node_modules/is-docker/cli.js +5 -0
  145. package/node_modules/is-docker/index.d.ts +13 -0
  146. package/node_modules/is-docker/index.js +29 -0
  147. package/node_modules/is-docker/license +9 -0
  148. package/node_modules/is-docker/package.json +44 -0
  149. package/node_modules/is-docker/readme.md +27 -0
  150. package/node_modules/is-in-ssh/index.d.ts +15 -0
  151. package/node_modules/is-in-ssh/index.js +7 -0
  152. package/node_modules/is-in-ssh/license +9 -0
  153. package/node_modules/is-in-ssh/package.json +43 -0
  154. package/node_modules/is-in-ssh/readme.md +43 -0
  155. package/node_modules/is-inside-container/cli.js +5 -0
  156. package/node_modules/is-inside-container/index.d.ts +13 -0
  157. package/node_modules/is-inside-container/index.js +23 -0
  158. package/node_modules/is-inside-container/license +9 -0
  159. package/node_modules/is-inside-container/package.json +51 -0
  160. package/node_modules/is-inside-container/readme.md +36 -0
  161. package/node_modules/is-wsl/index.d.ts +15 -0
  162. package/node_modules/is-wsl/index.js +36 -0
  163. package/node_modules/is-wsl/license +9 -0
  164. package/node_modules/is-wsl/package.json +58 -0
  165. package/node_modules/is-wsl/readme.md +21 -0
  166. package/node_modules/open/index.d.ts +158 -0
  167. package/node_modules/open/index.js +417 -0
  168. package/node_modules/open/license +9 -0
  169. package/node_modules/open/package.json +70 -0
  170. package/node_modules/open/readme.md +197 -0
  171. package/node_modules/open/xdg-open +1267 -0
  172. package/node_modules/powershell-utils/index.d.ts +122 -0
  173. package/node_modules/powershell-utils/index.js +58 -0
  174. package/node_modules/powershell-utils/license +9 -0
  175. package/node_modules/powershell-utils/package.json +47 -0
  176. package/node_modules/powershell-utils/readme.md +153 -0
  177. package/node_modules/run-applescript/index.d.ts +66 -0
  178. package/node_modules/run-applescript/index.js +37 -0
  179. package/node_modules/run-applescript/license +9 -0
  180. package/node_modules/run-applescript/package.json +42 -0
  181. package/node_modules/run-applescript/readme.md +78 -0
  182. package/node_modules/wsl-utils/index.d.ts +81 -0
  183. package/node_modules/wsl-utils/index.js +98 -0
  184. package/node_modules/wsl-utils/license +9 -0
  185. package/node_modules/wsl-utils/package.json +48 -0
  186. package/node_modules/wsl-utils/readme.md +111 -0
  187. package/node_modules/wsl-utils/utilities.js +19 -0
  188. package/package.json +14 -1
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "default-browser-id",
3
+ "version": "5.0.1",
4
+ "description": "Get the bundle identifier of the default browser (macOS). Example: com.apple.Safari",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/default-browser-id",
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
+ "sideEffects": false,
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "scripts": {
20
+ "test": "xo && ava"
21
+ },
22
+ "files": [
23
+ "index.js"
24
+ ],
25
+ "keywords": [
26
+ "macos",
27
+ "browser",
28
+ "default",
29
+ "plist",
30
+ "web",
31
+ "bundle",
32
+ "bundleid",
33
+ "id",
34
+ "identifier",
35
+ "uti"
36
+ ],
37
+ "devDependencies": {
38
+ "ava": "^6.0.1",
39
+ "xo": "^0.56.0"
40
+ }
41
+ }
@@ -0,0 +1,19 @@
1
+ # default-browser-id
2
+
3
+ > Get the [bundle identifier](https://developer.apple.com/library/Mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleIdentifier) of the default browser *(macOS)*\
4
+ > Example: `com.apple.Safari`
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm install default-browser-id
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```js
15
+ import defaultBrowserId from 'default-browser-id';
16
+
17
+ console.log(await defaultBrowserId());
18
+ //=> 'com.apple.Safari'
19
+ ```
@@ -0,0 +1,31 @@
1
+ /**
2
+ Define a [lazily evaluated](https://en.wikipedia.org/wiki/Lazy_evaluation) property on an object.
3
+
4
+ @param object - Object to add the property to.
5
+ @param propertyName - Name of the property to add.
6
+ @param valueGetter - Called the first time `propertyName` is accessed.
7
+
8
+ @example
9
+ ```
10
+ import defineLazyProperty from 'define-lazy-prop';
11
+
12
+ const unicorn = {
13
+ // …
14
+ };
15
+
16
+ defineLazyProperty(unicorn, 'rainbow', () => expensiveComputation());
17
+
18
+ app.on('user-action', () => {
19
+ doSomething(unicorn.rainbow);
20
+ });
21
+ ```
22
+ */
23
+ export default function defineLazyProperty<
24
+ ObjectType extends Record<string, any>,
25
+ PropertyNameType extends string,
26
+ PropertyValueType
27
+ >(
28
+ object: ObjectType,
29
+ propertyName: PropertyNameType,
30
+ valueGetter: () => PropertyValueType
31
+ ): ObjectType & {[K in PropertyNameType]: PropertyValueType};
@@ -0,0 +1,18 @@
1
+ export default function defineLazyProperty(object, propertyName, valueGetter) {
2
+ const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
3
+
4
+ Object.defineProperty(object, propertyName, {
5
+ configurable: true,
6
+ enumerable: true,
7
+ get() {
8
+ const result = valueGetter();
9
+ define(result);
10
+ return result;
11
+ },
12
+ set(value) {
13
+ define(value);
14
+ }
15
+ });
16
+
17
+ return object;
18
+ }
@@ -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": "define-lazy-prop",
3
+ "version": "3.0.0",
4
+ "description": "Define a lazily evaluated property on an object",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/define-lazy-prop",
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
+ "engines": {
16
+ "node": ">=12"
17
+ },
18
+ "scripts": {
19
+ "test": "xo && ava && tsd"
20
+ },
21
+ "files": [
22
+ "index.js",
23
+ "index.d.ts"
24
+ ],
25
+ "keywords": [
26
+ "lazy",
27
+ "property",
28
+ "properties",
29
+ "prop",
30
+ "define",
31
+ "object",
32
+ "value",
33
+ "lazily",
34
+ "laziness",
35
+ "evaluation",
36
+ "eval",
37
+ "execute",
38
+ "getter",
39
+ "function",
40
+ "fn",
41
+ "memoize",
42
+ "cache",
43
+ "defer",
44
+ "deferred"
45
+ ],
46
+ "devDependencies": {
47
+ "ava": "^3.15.0",
48
+ "tsd": "^0.14.0",
49
+ "xo": "^0.38.2"
50
+ }
51
+ }
@@ -0,0 +1,55 @@
1
+ # define-lazy-prop
2
+
3
+ > Define a [lazily evaluated](https://en.wikipedia.org/wiki/Lazy_evaluation) property on an object
4
+
5
+ Useful when the value of a property is expensive to generate, so you want to delay the computation until the property is needed. For example, improving startup performance by deferring nonessential operations.
6
+
7
+ ## Install
8
+
9
+ ```
10
+ $ npm install define-lazy-prop
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ import defineLazyProperty from 'define-lazy-prop';
17
+
18
+ const unicorn = {
19
+ // …
20
+ };
21
+
22
+ defineLazyProperty(unicorn, 'rainbow', () => expensiveComputation());
23
+
24
+ app.on('user-action', () => {
25
+ doSomething(unicorn.rainbow);
26
+ });
27
+ ```
28
+
29
+ ## API
30
+
31
+ ### defineLazyProperty(object, propertyName, valueGetter)
32
+
33
+ #### object
34
+
35
+ Type: `object`
36
+
37
+ Object to add the property to.
38
+
39
+ #### propertyName
40
+
41
+ Type: `string`
42
+
43
+ Name of the property to add.
44
+
45
+ #### valueGetter
46
+
47
+ Type: `Function`
48
+
49
+ Called the first time `propertyName` is accessed. Expected to return a value.
50
+
51
+ ## Related
52
+
53
+ - [lazy-value](https://github.com/sindresorhus/lazy-value) - Create a lazily evaluated value
54
+ - [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
55
+ - [p-lazy](https://github.com/sindresorhus/p-lazy) - Create a lazy promise
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import process from 'node:process';
3
+ import isDocker from './index.js';
4
+
5
+ process.exitCode = isDocker() ? 0 : 2;
@@ -0,0 +1,13 @@
1
+ /**
2
+ Check if the process is running inside a Docker container.
3
+
4
+ @example
5
+ ```
6
+ import isDocker from 'is-docker';
7
+
8
+ if (isDocker()) {
9
+ console.log('Running inside a Docker container');
10
+ }
11
+ ```
12
+ */
13
+ export default function isDocker(): boolean;
@@ -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,7 @@
1
+ import process from 'node:process';
2
+
3
+ const isInSsh = Boolean(process.env.SSH_CONNECTION
4
+ || process.env.SSH_CLIENT
5
+ || process.env.SSH_TTY);
6
+
7
+ 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,5 @@
1
+ #!/usr/bin/env node
2
+ import process from 'node:process';
3
+ import isInsideContainer from './index.js';
4
+
5
+ process.exitCode = isInsideContainer() ? 0 : 2;
@@ -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;