{"_id":"@pnpm/config.env-replace@1100.0.0","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"dist":{"shasum":"d86dfc43badab09b1724d0e090463a9da08c854b","tarball":"http://registry-npm.ywwl.com/@pnpm/config.env-replace/download/@pnpm/config.env-replace-1100.0.0.tgz","fileCount":8,"integrity":"sha512-+fyzur+UyCy6YYTSKiyRCt8yQc2aDWKJt+xxgIPcIHHIe4aP3Rrxp1MyA1QQ2M9cZt6adAKNF4HfBxFHJa1f4Q==","signatures":[{"sig":"MEYCIQDrT/Daepplq8YcP3VmJU3LaJLqhZWd8jQyRLU19oN/AwIhAKVpdxBhEwdbYx0T1pOedUdWHtwvkDDMTgNeTMfF2f5y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD5oTX/lVO2lIT+Q3DVZ6sZC405D94A+QHKMyLRGmugbQIhALdBsosm0dohi3u5eUSwn8eixZnfmREaslx9j9GsShvj"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pnpm%2fconfig.env-replace@1100.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9718,"size":3823,"noattachment":false,"key":"/@pnpm/config.env-replace/-/@pnpm/config.env-replace-1100.0.0.tgz"},"jest":{"preset":"@pnpm/jest-config"},"main":"lib/index.js","name":"@pnpm/config.env-replace","type":"module","types":"lib/index.d.ts","engines":{"node":">=22.13"},"exports":{".":"./lib/index.js"},"funding":"https://opencollective.com/pnpm","license":"MIT","scripts":{"lint":"eslint \"src/**/*.ts\" \"test/**/*.ts\"","test":"pn compile && pn .test",".test":"cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest","compile":"tsgo --build && pn lint --fix"},"version":"1100.0.0","_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"homepage":"https://github.com/pnpm/pnpm/tree/main/pnpm11/config/env-replace#readme","keywords":["pnpm","pnpm11","config","env"],"repository":{"url":"https://github.com/pnpm/pnpm/tree/main/pnpm11/config/env-replace","type":"git"},"description":"Replaces env variable placeholders in configuration settings","directories":{},"maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"_hasShrinkwrap":false,"devDependencies":{"@jest/globals":"30.4.1","@pnpm/config.env-replace":"1100.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/config.env-replace_1100.0.0_1790579705398_0.7248736799719064"},"readme":"# @pnpm/config.env-replace\n\n> Replaces env variable placeholders in configuration settings\n\n## `envReplace`\n\nStrict mode — throws when a `${VAR}` placeholder has no value and no default.\n\n```ts\nfunction envReplace(settingValue: string, env: NodeJS.ProcessEnv): string;\n```\n\n```ts\nimport { envReplace } from '@pnpm/config.env-replace'\n\nenvReplace('${foo}', process.env)\n```\n\n## `envReplaceLossy`\n\nLossy mode — replaces unresolved `${VAR}` placeholders with `''` and reports\nthem in `unresolved` instead of throwing. Resolvable placeholders and\n`${VAR-default}` / `${VAR:-default}` fallbacks elsewhere in the same string\nstill expand normally; only the genuinely unresolved bare ones are dropped.\n\nUse this when leaving the literal `${VAR}` in the substituted value would be\nworse than dropping it (e.g. auth tokens in `.npmrc` under OIDC trusted\npublishing).\n\n```ts\nfunction envReplaceLossy(\n  settingValue: string,\n  env: NodeJS.ProcessEnv\n): { value: string; unresolved: string[] };\n```\n\n```ts\nimport { envReplaceLossy } from '@pnpm/config.env-replace'\n\nconst { value, unresolved } = envReplaceLossy('${foo}-${missing}', process.env)\n// value:      'foo_value-'\n// unresolved: ['${missing}']\n```\n\n## Placeholder syntax\n\n- `${NAME}` — strict; the env var must be set (otherwise `envReplace` throws,\n  or `envReplaceLossy` substitutes `''` and records the placeholder).\n- `${NAME-fallback}` — `fallback` if `NAME` is unset.\n- `${NAME:-fallback}` — `fallback` if `NAME` is unset **or** an empty string.\n- A leading `\\` escapes the placeholder (`\\${NAME}` stays literal).\n\n`{ NAME: undefined }` in `env` is treated as **unset** for both functions —\nthe same as the key being absent. This matches the\n`Record<string, string | undefined>` shape of `NodeJS.ProcessEnv`, where\ncallers (notably tests) routinely model an unset variable as a\npresent-but-undefined property.\n\n## License\n\nMIT\n","publish_time":1790579705487,"_cnpm_publish_time":1790579705487,"dist-tags":{"latest":"1100.0.0"}}