@theholocron/env-utils 1.15.0 → 1.15.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/README.md +2 -2
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Runtime environment detection and typed env-var parsing.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
pnpm add @theholocron/env-utils
|
|
9
|
-
pnpm add
|
|
9
|
+
pnpm add dotenv # optional peer: install it if you import the package entry; `/lookup` does not need it
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
@@ -60,7 +60,7 @@ env.get("SENTRY_DSN"); // MYAPP_SENTRY_DSN, else SENTRY_DSN
|
|
|
60
60
|
|
|
61
61
|
### Importing without side effects
|
|
62
62
|
|
|
63
|
-
The package entry also exports `DotenvLoader`, whose module runs `import "dotenv/config"` and so loads `.env` into `process.env` the moment the package is imported. Libraries that only read variables should import from the `/lookup` subpath, which has `createEnvLookup`, `firstEnv` and `withEnvPrefix` and never touches dotenv:
|
|
63
|
+
The package entry also exports `DotenvLoader`, whose module runs `import "dotenv/config"` and so loads `.env` into `process.env` the moment the package is imported. Libraries that only read variables should import from the `/lookup` subpath, which has `createEnvLookup`, `firstEnv` and `withEnvPrefix` and never touches dotenv, so `dotenv` stays an optional peer dependency that you only install when you import the package entry:
|
|
64
64
|
|
|
65
65
|
```typescript
|
|
66
66
|
import { createEnvLookup, firstEnv } from "@theholocron/env-utils/lookup";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/env-utils",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "Runtime environment detection and typed env-var parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"env",
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"dotenv": ">=16"
|
|
50
50
|
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"dotenv": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
51
56
|
"engines": {
|
|
52
57
|
"node": ">=22"
|
|
53
58
|
},
|