{"name":"read-env-value","version":"2.0.1","keywords":["env","environment"],"author":{"name":"fengmk2"},"license":"MIT","_id":"read-env-value@2.0.1","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"homepage":"https://github.com/node-modules/read-env-value#readme","bugs":{"url":"https://github.com/node-modules/read-env-value/issues"},"dist":{"shasum":"6b956a685b184c8ad45b13f896b6791592f5fa94","tarball":"http://registry-npm.ywwl.com/read-env-value/download/read-env-value-2.0.1.tgz","fileCount":6,"integrity":"sha512-3sKLeaNpW4smWNYJpGb4Bi3t/G/BXRth9S58lq/RfpTE/Ppo1MCdxyQPMAHa+OW3uKOIsKP9Q55GSTLHab+d5A==","signatures":[{"sig":"MEUCIERjSLx8I/jg6tT66FDw0EyLyXt+Q7w3oTxHrmaAWqEaAiEA2ahJIqoglGvCROeCba62BdwrxFm+S/3nPDyZGgk8P0Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/read-env-value@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10970,"size":3892,"noattachment":false,"key":"/read-env-value/-/read-env-value-2.0.1.tgz"},"type":"module","types":"./dist/index.d.ts","engines":{"node":">= 22.17.0"},"exports":"./dist/index.js","gitHead":"e5c9aa0d39ac840efa127b9ad687d0b9a62fbd90","scripts":{"ci":"c8 -r html -r lcov -r text npm test","lint":"oxlint","test":"node --test --experimental-strip-types","preci":"npm run lint","postci":"npm run prepublishOnly","prepare":"husky","pretest":"npm run lint -- --fix","postversion":"npx sync-npm-version-to-jsr && git add jsr.json","prepublishOnly":"tsc -b --clean && tsc"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git+ssh://git@github.com/node-modules/read-env-value.git","type":"git"},"_npmVersion":"10.9.2","description":"Read env with default value","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown --cache","*.{ts,js,json,md,yml}":["prettier --ignore-unknown --write","oxlint --fix"]},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"devDependencies":{"c8":"10","mm":"4","husky":"9","oxlint":"1","prettier":"3","typescript":"5","@types/node":"24","@eggjs/tsconfig":"3"},"_npmOperationalInternal":{"tmp":"tmp/read-env-value_2.0.1_1753951299915_0.6438159269541595","host":"s3://npm-registry-packages-npm-production"},"readme":"# read-env-value\n\n[![NPM Version](https://img.shields.io/npm/v/read-env-value)](https://www.npmjs.com/package/read-env-value)\n[![NPM Downloads](https://img.shields.io/npm/dm/read-env-value)](https://www.npmjs.com/package/read-env-value)\n[![NPM License](https://img.shields.io/npm/l/read-env-value)](https://github.com/node-modules/read-env-value/blob/master/LICENSE)\n[![JSR](https://jsr.io/badges/@nm/read-env-value)](https://jsr.io/@nm/read-env-value)\n[![JSR Score](https://jsr.io/badges/@nm/read-env-value/score)](https://jsr.io/@nm/read-env-value)\n[![codecov](https://codecov.io/gh/node-modules/read-env-value/branch/master/graph/badge.svg)](https://codecov.io/gh/node-modules/read-env-value)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/node-modules/read-env-value/ci.yml?branch=master)](https://github.com/node-modules/read-env-value/actions/workflows/ci.yml?query=branch%3Amaster)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/node-modules/read-env-value)\n\nRead env with default value\n\n## Usage\n\n```ts\nimport { env } from 'read-env-value';\n\n// read env 'NODE_ENV' with default value 'development'\nconst value = env('NODE_ENV', 'string', 'development');\n```\n\n## API\n\n### env(key: string, type: 'string' | 'number' | 'boolean', defaultValue?: string | number | boolean)\n\n#### Parameters\n\n- `key`: The environment variable key to read.\n- `type`: The type of the value to be returned.\n- `defaultValue`: The default value to return if the environment variable is not set.\n\n#### Returns\n\n- The value of the environment variable.\n\n#### Example\n\n```ts\nimport { env } from 'read-env-value';\n\nconst value = env('NODE_ENV', 'string', 'development');\n```\n\n## License\n\n[MIT](./LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=node-modules/read-env-value)](https://github.com/node-modules/read-env-value/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","publish_time":1753951300106,"_cnpm_publish_time":1753951300106,"dist-tags":{"latest":"2.0.2"}}