bluelamp 3.0.7 → 3.0.9

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 (175) hide show
  1. package/bin/bluelamp-base +4 -7
  2. package/lib/mcp-server/dist/InteractiveLogin.js +27 -0
  3. package/lib/mcp-server/dist/PortalAuthClient.js +1 -0
  4. package/lib/mcp-server/dist/TokenManager.js +20 -0
  5. package/lib/mcp-server/dist/plugins/plugin-manager.d.ts.map +1 -1
  6. package/lib/mcp-server/dist/plugins/plugin-manager.js +1 -1
  7. package/lib/mcp-server/dist/plugins/plugin-manager.js.map +1 -1
  8. package/lib/mcp-server/dist/secure-mcp-server.d.ts.map +1 -1
  9. package/lib/mcp-server/dist/secure-mcp-server.js +18 -16
  10. package/lib/mcp-server/dist/secure-mcp-server.js.map +1 -1
  11. package/lib/mcp-server/dist/security/ApiKeyManager.d.ts.map +1 -1
  12. package/lib/mcp-server/dist/security/ApiKeyManager.js.map +1 -1
  13. package/lib/mcp-server/dist/security/PortalAuthClient.d.ts.map +1 -1
  14. package/lib/mcp-server/dist/security/PortalAuthClient.js +1 -205
  15. package/lib/mcp-server/dist/security/PortalAuthClient.js.map +1 -1
  16. package/lib/mcp-server/dist/security/SimpleAuthManager.js +1 -1
  17. package/lib/mcp-server/dist/security/SlotAuthClient.d.ts +47 -0
  18. package/lib/mcp-server/dist/security/SlotAuthClient.d.ts.map +1 -0
  19. package/lib/mcp-server/dist/security/SlotAuthClient.js +9 -0
  20. package/lib/mcp-server/dist/security/SlotAuthClient.js.map +1 -0
  21. package/lib/mcp-server/dist/security/TokenManager.d.ts.map +1 -1
  22. package/lib/mcp-server/dist/security/TokenManager.js.map +1 -1
  23. package/lib/mcp-server/node_modules/.package-lock.json +26 -0
  24. package/lib/mcp-server/node_modules/dotenv/CHANGELOG.md +592 -0
  25. package/lib/mcp-server/node_modules/dotenv/LICENSE +23 -0
  26. package/lib/mcp-server/node_modules/dotenv/README-es.md +405 -0
  27. package/lib/mcp-server/node_modules/dotenv/README.md +692 -0
  28. package/lib/mcp-server/node_modules/dotenv/SECURITY.md +1 -0
  29. package/lib/mcp-server/node_modules/dotenv/config.d.ts +1 -0
  30. package/lib/mcp-server/node_modules/dotenv/config.js +9 -0
  31. package/lib/mcp-server/node_modules/dotenv/lib/cli-options.js +17 -0
  32. package/lib/mcp-server/node_modules/dotenv/lib/env-options.js +28 -0
  33. package/lib/mcp-server/node_modules/dotenv/lib/main.d.ts +170 -0
  34. package/lib/mcp-server/node_modules/dotenv/lib/main.js +431 -0
  35. package/lib/mcp-server/node_modules/dotenv/package.json +62 -0
  36. package/lib/mcp-server/node_modules/typescript/LICENSE.txt +55 -0
  37. package/lib/mcp-server/node_modules/typescript/README.md +50 -0
  38. package/lib/mcp-server/node_modules/typescript/SECURITY.md +41 -0
  39. package/lib/mcp-server/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  40. package/lib/mcp-server/node_modules/typescript/bin/tsc +2 -0
  41. package/lib/mcp-server/node_modules/typescript/bin/tsserver +2 -0
  42. package/lib/mcp-server/node_modules/typescript/lib/_tsc.js +133792 -0
  43. package/lib/mcp-server/node_modules/typescript/lib/_tsserver.js +659 -0
  44. package/lib/mcp-server/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  45. package/lib/mcp-server/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  46. package/lib/mcp-server/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  47. package/lib/mcp-server/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  48. package/lib/mcp-server/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  49. package/lib/mcp-server/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  50. package/lib/mcp-server/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  51. package/lib/mcp-server/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  52. package/lib/mcp-server/node_modules/typescript/lib/lib.d.ts +22 -0
  53. package/lib/mcp-server/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  54. package/lib/mcp-server/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  55. package/lib/mcp-server/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  56. package/lib/mcp-server/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  57. package/lib/mcp-server/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  58. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  59. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  60. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  61. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  62. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  63. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  64. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  65. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  66. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  67. package/lib/mcp-server/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  68. package/lib/mcp-server/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  69. package/lib/mcp-server/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  70. package/lib/mcp-server/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  71. package/lib/mcp-server/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  72. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  73. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  74. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  75. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  76. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  77. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  78. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  79. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  80. package/lib/mcp-server/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  81. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  82. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  83. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  84. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  85. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  86. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  87. package/lib/mcp-server/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  88. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  89. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  90. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  91. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  92. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  93. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  94. package/lib/mcp-server/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  95. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  96. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  97. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  98. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  99. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  100. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  101. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  102. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  103. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  104. package/lib/mcp-server/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  105. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  106. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  107. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  108. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  109. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  110. package/lib/mcp-server/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  111. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  112. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  113. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  114. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  115. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  116. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  117. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  118. package/lib/mcp-server/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  119. package/lib/mcp-server/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  120. package/lib/mcp-server/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  121. package/lib/mcp-server/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  122. package/lib/mcp-server/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  123. package/lib/mcp-server/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  124. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  125. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  126. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  127. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  128. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  129. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  130. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  131. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  132. package/lib/mcp-server/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  133. package/lib/mcp-server/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  134. package/lib/mcp-server/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  135. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  136. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  137. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  138. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  139. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  140. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  141. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.float16.d.ts +443 -0
  142. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  143. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  144. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  145. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  146. package/lib/mcp-server/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  147. package/lib/mcp-server/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  148. package/lib/mcp-server/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  149. package/lib/mcp-server/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  150. package/lib/mcp-server/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  151. package/lib/mcp-server/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  152. package/lib/mcp-server/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  153. package/lib/mcp-server/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  154. package/lib/mcp-server/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  155. package/lib/mcp-server/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  156. package/lib/mcp-server/node_modules/typescript/lib/tsc.js +8 -0
  157. package/lib/mcp-server/node_modules/typescript/lib/tsserver.js +8 -0
  158. package/lib/mcp-server/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  159. package/lib/mcp-server/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  160. package/lib/mcp-server/node_modules/typescript/lib/typesMap.json +497 -0
  161. package/lib/mcp-server/node_modules/typescript/lib/typescript.d.ts +11438 -0
  162. package/lib/mcp-server/node_modules/typescript/lib/typescript.js +200253 -0
  163. package/lib/mcp-server/node_modules/typescript/lib/typingsInstaller.js +8 -0
  164. package/lib/mcp-server/node_modules/typescript/lib/watchGuard.js +53 -0
  165. package/lib/mcp-server/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  166. package/lib/mcp-server/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  167. package/lib/mcp-server/node_modules/typescript/package.json +120 -0
  168. package/lib/mcp-server/package-lock.json +13 -0
  169. package/lib/mcp-server/package.json +1 -0
  170. package/lib/mcp-server/src/plugins/plugin-manager.ts +0 -146
  171. package/lib/mcp-server/src/secure-mcp-server.ts +21 -10
  172. package/lib/mcp-server/src/security/ApiKeyManager.ts +1 -1
  173. package/lib/mcp-server/src/security/SlotAuthClient.ts +225 -0
  174. package/lib/mcp-server/src/security/TokenManager.ts +1 -1
  175. package/package.json +2 -1
@@ -0,0 +1,692 @@
1
+ <div align="center">
2
+ 🎉 announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>.
3
+ </div>
4
+
5
+ &nbsp;
6
+
7
+ <div align="center">
8
+
9
+ **Special thanks to [our sponsors](https://github.com/sponsors/motdotla)**
10
+
11
+ <a href="https://tuple.app/dotenv">
12
+ <div>
13
+ <img src="https://res.cloudinary.com/dotenv-org/image/upload/w_1000,ar_16:9,c_fill,g_auto,e_sharpen/v1756831704/github_repo_sponsorship_gq4hvx.png" width="600" alt="Tuple">
14
+ </div>
15
+ <b>Tuple, the premier screen sharing app for developers on macOS and Windows.</b>
16
+ </a>
17
+ <hr>
18
+ </div>
19
+
20
+ # dotenv [![NPM version](https://img.shields.io/npm/v/dotenv.svg?style=flat-square)](https://www.npmjs.com/package/dotenv)
21
+
22
+ <img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv" align="right" width="200" />
23
+
24
+ Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](https://12factor.net/config) methodology.
25
+
26
+ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
27
+ [![LICENSE](https://img.shields.io/github/license/motdotla/dotenv.svg)](LICENSE)
28
+ [![codecov](https://codecov.io/gh/motdotla/dotenv-expand/graph/badge.svg?token=pawWEyaMfg)](https://codecov.io/gh/motdotla/dotenv-expand)
29
+
30
+ * [🌱 Install](#-install)
31
+ * [🏗️ Usage (.env)](#%EF%B8%8F-usage)
32
+ * [🌴 Multiple Environments 🆕](#-manage-multiple-environments)
33
+ * [🚀 Deploying (encryption) 🆕](#-deploying)
34
+ * [📚 Examples](#-examples)
35
+ * [📖 Docs](#-documentation)
36
+ * [❓ FAQ](#-faq)
37
+ * [⏱️ Changelog](./CHANGELOG.md)
38
+
39
+ ## 🌱 Install
40
+
41
+ ```bash
42
+ npm install dotenv --save
43
+ ```
44
+
45
+ You can also use an npm-compatible package manager like yarn, bun or pnpm:
46
+
47
+ ```bash
48
+ yarn add dotenv
49
+ ```
50
+ ```bash
51
+ bun add dotenv
52
+ ```
53
+ ```bash
54
+ pnpm add dotenv
55
+ ```
56
+
57
+ ## 🏗️ Usage
58
+
59
+ <a href="https://www.youtube.com/watch?v=YtkZR0NFd1g">
60
+ <div align="right">
61
+ <img src="https://img.youtube.com/vi/YtkZR0NFd1g/hqdefault.jpg" alt="how to use dotenv video tutorial" align="right" width="330" />
62
+ <img src="https://simpleicons.vercel.app/youtube/ff0000" alt="youtube/@dotenvorg" align="right" width="24" />
63
+ </div>
64
+ </a>
65
+
66
+ Create a `.env` file in the root of your project (if using a monorepo structure like `apps/backend/app.js`, put it in the root of the folder where your `app.js` process runs):
67
+
68
+ ```dosini
69
+ S3_BUCKET="YOURS3BUCKET"
70
+ SECRET_KEY="YOURSECRETKEYGOESHERE"
71
+ ```
72
+
73
+ As early as possible in your application, import and configure dotenv:
74
+
75
+ ```javascript
76
+ require('dotenv').config()
77
+ console.log(process.env) // remove this after you've confirmed it is working
78
+ ```
79
+
80
+ .. [or using ES6?](#how-do-i-use-dotenv-with-import)
81
+
82
+ ```javascript
83
+ import 'dotenv/config'
84
+ ```
85
+
86
+ ES6 import if you need to set config options:
87
+
88
+ ```javascript
89
+ import dotenv from 'dotenv'
90
+
91
+ dotenv.config({ path: '/custom/path/to/.env' })
92
+ ```
93
+
94
+ That's it. `process.env` now has the keys and values you defined in your `.env` file:
95
+
96
+ ```javascript
97
+ require('dotenv').config()
98
+ // or import 'dotenv/config' if you're using ES6
99
+
100
+ ...
101
+
102
+ s3.getBucketCors({Bucket: process.env.S3_BUCKET}, function(err, data) {})
103
+ ```
104
+
105
+ ### Multiline values
106
+
107
+ If you need multiline variables, for example private keys, those are now supported (`>= v15.0.0`) with line breaks:
108
+
109
+ ```dosini
110
+ PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
111
+ ...
112
+ Kh9NV...
113
+ ...
114
+ -----END RSA PRIVATE KEY-----"
115
+ ```
116
+
117
+ Alternatively, you can double quote strings and use the `\n` character:
118
+
119
+ ```dosini
120
+ PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nKh9NV...\n-----END RSA PRIVATE KEY-----\n"
121
+ ```
122
+
123
+ ### Comments
124
+
125
+ Comments may be added to your file on their own line or inline:
126
+
127
+ ```dosini
128
+ # This is a comment
129
+ SECRET_KEY=YOURSECRETKEYGOESHERE # comment
130
+ SECRET_HASH="something-with-a-#-hash"
131
+ ```
132
+
133
+ Comments begin where a `#` exists, so if your value contains a `#` please wrap it in quotes. This is a breaking change from `>= v15.0.0` and on.
134
+
135
+ ### Parsing
136
+
137
+ The engine which parses the contents of your file containing environment variables is available to use. It accepts a String or Buffer and will return an Object with the parsed keys and values.
138
+
139
+ ```javascript
140
+ const dotenv = require('dotenv')
141
+ const buf = Buffer.from('BASIC=basic')
142
+ const config = dotenv.parse(buf) // will return an object
143
+ console.log(typeof config, config) // object { BASIC : 'basic' }
144
+ ```
145
+
146
+ ### Preload
147
+
148
+ > Note: Consider using [`dotenvx`](https://github.com/dotenvx/dotenvx) instead of preloading. I am now doing (and recommending) so.
149
+ >
150
+ > It serves the same purpose (you do not need to require and load dotenv), adds better debugging, and works with ANY language, framework, or platform. – [motdotla](https://github.com/motdotla)
151
+
152
+ You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#-r---require-module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code.
153
+
154
+ ```bash
155
+ $ node -r dotenv/config your_script.js
156
+ ```
157
+
158
+ The configuration options below are supported as command line arguments in the format `dotenv_config_<option>=value`
159
+
160
+ ```bash
161
+ $ node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env dotenv_config_debug=true
162
+ ```
163
+
164
+ Additionally, you can use environment variables to set configuration options. Command line arguments will precede these.
165
+
166
+ ```bash
167
+ $ DOTENV_CONFIG_<OPTION>=value node -r dotenv/config your_script.js
168
+ ```
169
+
170
+ ```bash
171
+ $ DOTENV_CONFIG_ENCODING=latin1 DOTENV_CONFIG_DEBUG=true node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env
172
+ ```
173
+
174
+ ### Variable Expansion
175
+
176
+ Use [dotenvx](https://github.com/dotenvx/dotenvx) to use variable expansion.
177
+
178
+ Reference and expand variables already on your machine for use in your .env file.
179
+
180
+ ```ini
181
+ # .env
182
+ USERNAME="username"
183
+ DATABASE_URL="postgres://${USERNAME}@localhost/my_database"
184
+ ```
185
+ ```js
186
+ // index.js
187
+ console.log('DATABASE_URL', process.env.DATABASE_URL)
188
+ ```
189
+ ```sh
190
+ $ dotenvx run --debug -- node index.js
191
+ [dotenvx@0.14.1] injecting env (2) from .env
192
+ DATABASE_URL postgres://username@localhost/my_database
193
+ ```
194
+
195
+ ### Command Substitution
196
+
197
+ Use [dotenvx](https://github.com/dotenvx/dotenvx) to use command substitution.
198
+
199
+ Add the output of a command to one of your variables in your .env file.
200
+
201
+ ```ini
202
+ # .env
203
+ DATABASE_URL="postgres://$(whoami)@localhost/my_database"
204
+ ```
205
+ ```js
206
+ // index.js
207
+ console.log('DATABASE_URL', process.env.DATABASE_URL)
208
+ ```
209
+ ```sh
210
+ $ dotenvx run --debug -- node index.js
211
+ [dotenvx@0.14.1] injecting env (1) from .env
212
+ DATABASE_URL postgres://yourusername@localhost/my_database
213
+ ```
214
+
215
+ ### Syncing
216
+
217
+ You need to keep `.env` files in sync between machines, environments, or team members? Use [dotenvx](https://github.com/dotenvx/dotenvx) to encrypt your `.env` files and safely include them in source control. This still subscribes to the twelve-factor app rules by generating a decryption key separate from code.
218
+
219
+ ### Multiple Environments
220
+
221
+ Use [dotenvx](https://github.com/dotenvx/dotenvx) to generate `.env.ci`, `.env.production` files, and more.
222
+
223
+ ### Deploying
224
+
225
+ You need to deploy your secrets in a cloud-agnostic manner? Use [dotenvx](https://github.com/dotenvx/dotenvx) to generate a private decryption key that is set on your production server.
226
+
227
+ ## 🌴 Manage Multiple Environments
228
+
229
+ Use [dotenvx](https://github.com/dotenvx/dotenvx)
230
+
231
+ Run any environment locally. Create a `.env.ENVIRONMENT` file and use `--env-file` to load it. It's straightforward, yet flexible.
232
+
233
+ ```bash
234
+ $ echo "HELLO=production" > .env.production
235
+ $ echo "console.log('Hello ' + process.env.HELLO)" > index.js
236
+
237
+ $ dotenvx run --env-file=.env.production -- node index.js
238
+ Hello production
239
+ > ^^
240
+ ```
241
+
242
+ or with multiple .env files
243
+
244
+ ```bash
245
+ $ echo "HELLO=local" > .env.local
246
+ $ echo "HELLO=World" > .env
247
+ $ echo "console.log('Hello ' + process.env.HELLO)" > index.js
248
+
249
+ $ dotenvx run --env-file=.env.local --env-file=.env -- node index.js
250
+ Hello local
251
+ ```
252
+
253
+ [more environment examples](https://dotenvx.com/docs/quickstart/environments)
254
+
255
+ ## 🚀 Deploying
256
+
257
+ Use [dotenvx](https://github.com/dotenvx/dotenvx).
258
+
259
+ Add encryption to your `.env` files with a single command. Pass the `--encrypt` flag.
260
+
261
+ ```
262
+ $ dotenvx set HELLO Production --encrypt -f .env.production
263
+ $ echo "console.log('Hello ' + process.env.HELLO)" > index.js
264
+
265
+ $ DOTENV_PRIVATE_KEY_PRODUCTION="<.env.production private key>" dotenvx run -- node index.js
266
+ [dotenvx] injecting env (2) from .env.production
267
+ Hello Production
268
+ ```
269
+
270
+ [learn more](https://github.com/dotenvx/dotenvx?tab=readme-ov-file#encryption)
271
+
272
+ ## 📚 Examples
273
+
274
+ See [examples](https://github.com/dotenv-org/examples) of using dotenv with various frameworks, languages, and configurations.
275
+
276
+ * [nodejs](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs)
277
+ * [nodejs (debug on)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs-debug)
278
+ * [nodejs (override on)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs-override)
279
+ * [nodejs (processEnv override)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-custom-target)
280
+ * [esm](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-esm)
281
+ * [esm (preload)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-esm-preload)
282
+ * [typescript](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript)
283
+ * [typescript parse](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript-parse)
284
+ * [typescript config](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript-config)
285
+ * [webpack](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-webpack)
286
+ * [webpack (plugin)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-webpack2)
287
+ * [react](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-react)
288
+ * [react (typescript)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-react-typescript)
289
+ * [express](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-express)
290
+ * [nestjs](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nestjs)
291
+ * [fastify](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-fastify)
292
+
293
+ ## 📖 Documentation
294
+
295
+ Dotenv exposes four functions:
296
+
297
+ * `config`
298
+ * `parse`
299
+ * `populate`
300
+
301
+ ### Config
302
+
303
+ `config` will read your `.env` file, parse the contents, assign it to
304
+ [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env),
305
+ and return an Object with a `parsed` key containing the loaded content or an `error` key if it failed.
306
+
307
+ ```js
308
+ const result = dotenv.config()
309
+
310
+ if (result.error) {
311
+ throw result.error
312
+ }
313
+
314
+ console.log(result.parsed)
315
+ ```
316
+
317
+ You can additionally, pass options to `config`.
318
+
319
+ #### Options
320
+
321
+ ##### path
322
+
323
+ Default: `path.resolve(process.cwd(), '.env')`
324
+
325
+ Specify a custom path if your file containing environment variables is located elsewhere.
326
+
327
+ ```js
328
+ require('dotenv').config({ path: '/custom/path/to/.env' })
329
+ ```
330
+
331
+ By default, `config` will look for a file called .env in the current working directory.
332
+
333
+ Pass in multiple files as an array, and they will be parsed in order and combined with `process.env` (or `option.processEnv`, if set). The first value set for a variable will win, unless the `options.override` flag is set, in which case the last value set will win. If a value already exists in `process.env` and the `options.override` flag is NOT set, no changes will be made to that value.
334
+
335
+ ```js
336
+ require('dotenv').config({ path: ['.env.local', '.env'] })
337
+ ```
338
+
339
+ ##### quiet
340
+
341
+ Default: `false`
342
+
343
+ Suppress runtime logging message.
344
+
345
+ ```js
346
+ // index.js
347
+ require('dotenv').config({ quiet: false }) // change to true to suppress
348
+ console.log(`Hello ${process.env.HELLO}`)
349
+ ```
350
+
351
+ ```ini
352
+ # .env
353
+ .env
354
+ ```
355
+
356
+ ```sh
357
+ $ node index.js
358
+ [dotenv@17.0.0] injecting env (1) from .env
359
+ Hello World
360
+ ```
361
+
362
+ ##### encoding
363
+
364
+ Default: `utf8`
365
+
366
+ Specify the encoding of your file containing environment variables.
367
+
368
+ ```js
369
+ require('dotenv').config({ encoding: 'latin1' })
370
+ ```
371
+
372
+ ##### debug
373
+
374
+ Default: `false`
375
+
376
+ Turn on logging to help debug why certain keys or values are not being set as you expect.
377
+
378
+ ```js
379
+ require('dotenv').config({ debug: process.env.DEBUG })
380
+ ```
381
+
382
+ ##### override
383
+
384
+ Default: `false`
385
+
386
+ Override any environment variables that have already been set on your machine with values from your .env file(s). If multiple files have been provided in `option.path` the override will also be used as each file is combined with the next. Without `override` being set, the first value wins. With `override` set the last value wins.
387
+
388
+ ```js
389
+ require('dotenv').config({ override: true })
390
+ ```
391
+
392
+ ##### processEnv
393
+
394
+ Default: `process.env`
395
+
396
+ Specify an object to write your environment variables to. Defaults to `process.env` environment variables.
397
+
398
+ ```js
399
+ const myObject = {}
400
+ require('dotenv').config({ processEnv: myObject })
401
+
402
+ console.log(myObject) // values from .env
403
+ console.log(process.env) // this was not changed or written to
404
+ ```
405
+
406
+ ### Parse
407
+
408
+ The engine which parses the contents of your file containing environment
409
+ variables is available to use. It accepts a String or Buffer and will return
410
+ an Object with the parsed keys and values.
411
+
412
+ ```js
413
+ const dotenv = require('dotenv')
414
+ const buf = Buffer.from('BASIC=basic')
415
+ const config = dotenv.parse(buf) // will return an object
416
+ console.log(typeof config, config) // object { BASIC : 'basic' }
417
+ ```
418
+
419
+ #### Options
420
+
421
+ ##### debug
422
+
423
+ Default: `false`
424
+
425
+ Turn on logging to help debug why certain keys or values are not being set as you expect.
426
+
427
+ ```js
428
+ const dotenv = require('dotenv')
429
+ const buf = Buffer.from('hello world')
430
+ const opt = { debug: true }
431
+ const config = dotenv.parse(buf, opt)
432
+ // expect a debug message because the buffer is not in KEY=VAL form
433
+ ```
434
+
435
+ ### Populate
436
+
437
+ The engine which populates the contents of your .env file to `process.env` is available for use. It accepts a target, a source, and options. This is useful for power users who want to supply their own objects.
438
+
439
+ For example, customizing the source:
440
+
441
+ ```js
442
+ const dotenv = require('dotenv')
443
+ const parsed = { HELLO: 'world' }
444
+
445
+ dotenv.populate(process.env, parsed)
446
+
447
+ console.log(process.env.HELLO) // world
448
+ ```
449
+
450
+ For example, customizing the source AND target:
451
+
452
+ ```js
453
+ const dotenv = require('dotenv')
454
+ const parsed = { HELLO: 'universe' }
455
+ const target = { HELLO: 'world' } // empty object
456
+
457
+ dotenv.populate(target, parsed, { override: true, debug: true })
458
+
459
+ console.log(target) // { HELLO: 'universe' }
460
+ ```
461
+
462
+ #### options
463
+
464
+ ##### Debug
465
+
466
+ Default: `false`
467
+
468
+ Turn on logging to help debug why certain keys or values are not being populated as you expect.
469
+
470
+ ##### override
471
+
472
+ Default: `false`
473
+
474
+ Override any environment variables that have already been set.
475
+
476
+ ## ❓ FAQ
477
+
478
+ ### Why is the `.env` file not loading my environment variables successfully?
479
+
480
+ Most likely your `.env` file is not in the correct place. [See this stack overflow](https://stackoverflow.com/questions/42335016/dotenv-file-is-not-loading-environment-variables).
481
+
482
+ Turn on debug mode and try again..
483
+
484
+ ```js
485
+ require('dotenv').config({ debug: true })
486
+ ```
487
+
488
+ You will receive a helpful error outputted to your console.
489
+
490
+ ### Should I commit my `.env` file?
491
+
492
+ No. We **strongly** recommend against committing your `.env` file to version
493
+ control. It should only include environment-specific values such as database
494
+ passwords or API keys. Your production database should have a different
495
+ password than your development database.
496
+
497
+ ### Should I have multiple `.env` files?
498
+
499
+ We recommend creating one `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file.
500
+
501
+ > In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.
502
+ >
503
+ > – [The Twelve-Factor App](http://12factor.net/config)
504
+
505
+ ### What rules does the parsing engine follow?
506
+
507
+ The parsing engine currently supports the following rules:
508
+
509
+ - `BASIC=basic` becomes `{BASIC: 'basic'}`
510
+ - empty lines are skipped
511
+ - lines beginning with `#` are treated as comments
512
+ - `#` marks the beginning of a comment (unless when the value is wrapped in quotes)
513
+ - empty values become empty strings (`EMPTY=` becomes `{EMPTY: ''}`)
514
+ - inner quotes are maintained (think JSON) (`JSON={"foo": "bar"}` becomes `{JSON:"{\"foo\": \"bar\"}"`)
515
+ - whitespace is removed from both ends of unquoted values (see more on [`trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)) (`FOO= some value ` becomes `{FOO: 'some value'}`)
516
+ - single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: "quoted"}`)
517
+ - single and double quoted values maintain whitespace from both ends (`FOO=" some value "` becomes `{FOO: ' some value '}`)
518
+ - double quoted values expand new lines (`MULTILINE="new\nline"` becomes
519
+
520
+ ```
521
+ {MULTILINE: 'new
522
+ line'}
523
+ ```
524
+
525
+ - backticks are supported (`` BACKTICK_KEY=`This has 'single' and "double" quotes inside of it.` ``)
526
+
527
+ ### What happens to environment variables that were already set?
528
+
529
+ By default, we will never modify any environment variables that have already been set. In particular, if there is a variable in your `.env` file which collides with one that already exists in your environment, then that variable will be skipped.
530
+
531
+ If instead, you want to override `process.env` use the `override` option.
532
+
533
+ ```javascript
534
+ require('dotenv').config({ override: true })
535
+ ```
536
+
537
+ ### How come my environment variables are not showing up for React?
538
+
539
+ Your React code is run in Webpack, where the `fs` module or even the `process` global itself are not accessible out-of-the-box. `process.env` can only be injected through Webpack configuration.
540
+
541
+ If you are using [`react-scripts`](https://www.npmjs.com/package/react-scripts), which is distributed through [`create-react-app`](https://create-react-app.dev/), it has dotenv built in but with a quirk. Preface your environment variables with `REACT_APP_`. See [this stack overflow](https://stackoverflow.com/questions/42182577/is-it-possible-to-use-dotenv-in-a-react-project) for more details.
542
+
543
+ If you are using other frameworks (e.g. Next.js, Gatsby...), you need to consult their documentation for how to inject environment variables into the client.
544
+
545
+ ### Can I customize/write plugins for dotenv?
546
+
547
+ Yes! `dotenv.config()` returns an object representing the parsed `.env` file. This gives you everything you need to continue setting values on `process.env`. For example:
548
+
549
+ ```js
550
+ const dotenv = require('dotenv')
551
+ const variableExpansion = require('dotenv-expand')
552
+ const myEnv = dotenv.config()
553
+ variableExpansion(myEnv)
554
+ ```
555
+
556
+ ### How do I use dotenv with `import`?
557
+
558
+ Simply..
559
+
560
+ ```javascript
561
+ // index.mjs (ESM)
562
+ import 'dotenv/config' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
563
+ import express from 'express'
564
+ ```
565
+
566
+ A little background..
567
+
568
+ > When you run a module containing an `import` declaration, the modules it imports are loaded first, then each module body is executed in a depth-first traversal of the dependency graph, avoiding cycles by skipping anything already executed.
569
+ >
570
+ > – [ES6 In Depth: Modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/)
571
+
572
+ What does this mean in plain language? It means you would think the following would work but it won't.
573
+
574
+ `errorReporter.mjs`:
575
+ ```js
576
+ class Client {
577
+ constructor (apiKey) {
578
+ console.log('apiKey', apiKey)
579
+
580
+ this.apiKey = apiKey
581
+ }
582
+ }
583
+
584
+ export default new Client(process.env.API_KEY)
585
+ ```
586
+ `index.mjs`:
587
+ ```js
588
+ // Note: this is INCORRECT and will not work
589
+ import * as dotenv from 'dotenv'
590
+ dotenv.config()
591
+
592
+ import errorReporter from './errorReporter.mjs' // process.env.API_KEY will be blank!
593
+ ```
594
+
595
+ `process.env.API_KEY` will be blank.
596
+
597
+ Instead, `index.mjs` should be written as..
598
+
599
+ ```js
600
+ import 'dotenv/config'
601
+
602
+ import errorReporter from './errorReporter.mjs'
603
+ ```
604
+
605
+ Does that make sense? It's a bit unintuitive, but it is how importing of ES6 modules work. Here is a [working example of this pitfall](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-es6-import-pitfall).
606
+
607
+ There are two alternatives to this approach:
608
+
609
+ 1. Preload with dotenvx: `dotenvx run -- node index.js` (_Note: you do not need to `import` dotenv with this approach_)
610
+ 2. Create a separate file that will execute `config` first as outlined in [this comment on #133](https://github.com/motdotla/dotenv/issues/133#issuecomment-255298822)
611
+
612
+ ### Why am I getting the error `Module not found: Error: Can't resolve 'crypto|os|path'`?
613
+
614
+ You are using dotenv on the front-end and have not included a polyfill. Webpack < 5 used to include these for you. Do the following:
615
+
616
+ ```bash
617
+ npm install node-polyfill-webpack-plugin
618
+ ```
619
+
620
+ Configure your `webpack.config.js` to something like the following.
621
+
622
+ ```js
623
+ require('dotenv').config()
624
+
625
+ const path = require('path');
626
+ const webpack = require('webpack')
627
+
628
+ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
629
+
630
+ module.exports = {
631
+ mode: 'development',
632
+ entry: './src/index.ts',
633
+ output: {
634
+ filename: 'bundle.js',
635
+ path: path.resolve(__dirname, 'dist'),
636
+ },
637
+ plugins: [
638
+ new NodePolyfillPlugin(),
639
+ new webpack.DefinePlugin({
640
+ 'process.env': {
641
+ HELLO: JSON.stringify(process.env.HELLO)
642
+ }
643
+ }),
644
+ ]
645
+ };
646
+ ```
647
+
648
+ Alternatively, just use [dotenv-webpack](https://github.com/mrsteele/dotenv-webpack) which does this and more behind the scenes for you.
649
+
650
+ ### What about variable expansion?
651
+
652
+ Try [dotenv-expand](https://github.com/motdotla/dotenv-expand)
653
+
654
+ ### What about syncing and securing .env files?
655
+
656
+ Use [dotenvx](https://github.com/dotenvx/dotenvx) to unlock syncing encrypted .env files over git.
657
+
658
+ ### What if I accidentally commit my `.env` file to code?
659
+
660
+ Remove it, [remove git history](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository) and then install the [git pre-commit hook](https://github.com/dotenvx/dotenvx#pre-commit) to prevent this from ever happening again.
661
+
662
+ ```
663
+ brew install dotenvx/brew/dotenvx
664
+ dotenvx precommit --install
665
+ ```
666
+
667
+ ### How can I prevent committing my `.env` file to a Docker build?
668
+
669
+ Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild).
670
+
671
+ ```bash
672
+ # Dockerfile
673
+ ...
674
+ RUN curl -fsS https://dotenvx.sh/ | sh
675
+ ...
676
+ RUN dotenvx prebuild
677
+ CMD ["dotenvx", "run", "--", "node", "index.js"]
678
+ ```
679
+
680
+ ## Contributing Guide
681
+
682
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
683
+
684
+ ## CHANGELOG
685
+
686
+ See [CHANGELOG.md](CHANGELOG.md)
687
+
688
+ ## Who's using dotenv?
689
+
690
+ [These npm modules depend on it.](https://www.npmjs.com/browse/depended/dotenv)
691
+
692
+ Projects that expand it often use the [keyword "dotenv" on npm](https://www.npmjs.com/search?q=keywords:dotenv).
@@ -0,0 +1 @@
1
+ Please report any security vulnerabilities to security@dotenvx.com.
@@ -0,0 +1 @@
1
+ export {};