{"name":"dotenv-defaults","version":"6.0.0","description":"dotenv... but with defaults!","type":"module","main":"src/index.js","exports":{".":"./src/index.js","./config":"./config.js"},"engines":{"node":">=18.0.0"},"scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","lint":"standard"},"repository":{"type":"git","url":"git+https://github.com/mrsteele/dotenv-defaults.git"},"keywords":["dotenv","defaults","extension","env","default","fallback"],"author":{"name":"Matt Steele","email":"matt@omnionline.us","url":"http://omnionline.us/"},"license":"MIT","bugs":{"url":"https://github.com/mrsteele/dotenv-defaults/issues"},"types":"./src/index.d.ts","homepage":"https://github.com/mrsteele/dotenv-defaults#readme","dependencies":{"dotenv":"^16.4.7"},"devDependencies":{"@types/node":"^22.10.2","jest":"^29.7.0","standard":"^17.1.2"},"jest":{"coverageDirectory":"./coverage/","collectCoverage":true,"testEnvironment":"node"},"_id":"dotenv-defaults@6.0.0","gitHead":"c0b418797c7493471d356755b8f29a12c65c6018","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-188MG1/VIYdj9tHfi/CKdkLWprlzIL0djWIVqVAjNHgpFUprIr+zvAQcs3E1gA1ItIiC3DijuQcrasc+cMJdlQ==","shasum":"f0470461af3da440c7a4b2dfd73d6ac4770a2df8","tarball":"http://registry-npm.ywwl.com/dotenv-defaults/download/dotenv-defaults-6.0.0.tgz","fileCount":8,"unpackedSize":10464,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA4u1MgOnR+gCNYnX1RkYhkY94RdP25Lfh4jGu0aZfebAiEAwL8Ya2FjAiWxfZJSZF6o68RBWn45dlFgPXXDktyD4xE="}],"size":3975,"noattachment":false,"key":"/dotenv-defaults/-/dotenv-defaults-6.0.0.tgz"},"_npmUser":{"name":"mrsteele","email":"matthewsteele1@hotmail.com"},"directories":{},"maintainers":[{"name":"mrsteele","email":"matthewsteele1@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dotenv-defaults_6.0.0_1770002324034_0.6408691643453113"},"_hasShrinkwrap":false,"readme":"# dotenv-defaults\n\nA dotenv system that supports defaults.\n\n### Status\n\n![npm](https://img.shields.io/npm/v/dotenv-defaults.svg)\n[![Main](https://github.com/mrsteele/dotenv-defaults/actions/workflows/main.yml/badge.svg)](https://github.com/mrsteele/dotenv-defaults/actions/workflows/main.yml)\n[![dotenv-vault](https://badge.dotenv.org/works-with.svg?r=3)](https://www.dotenv.org/get-started?r=3)\n\n### Installation\n\nUse the following to install this module:\n\n```\nnpm i dotenv-defaults --save\n```\n\n### Usage\n\nThis module supports all the features from the original [dotenv](https://www.npmjs.com/package/dotenv) module, so usage should be simple enough:\n\n```\n# .env.defaults, safe to commit\nHOST=website.com\nEMAIL=test@email.com\n```\n\n```\n# .env, DO NOT COMMIT\nHOST=mrsteele.dev\n```\n\nThe result\n\n```js\n// ESM (Node.js 18+)\nimport { config } from 'dotenv-defaults'\nconfig()\n\n// Or load it directly like this\nimport 'dotenv-defaults/config'\n\nconsole.log(process.env.HOST)\n// Outputs: mrsteele.dev\n\nconsole.log(process.env.EMAIL)\n// Outputs: test@email.com\n```\n\n##### TypeScript\nThis module now includes full TypeScript type definitions and works seamlessly with TypeScript:\n\n```typescript\nimport { config, parse, type ConfigOptions } from 'dotenv-defaults'\n\n// Or load directly\nimport 'dotenv-defaults/config'\n\nconst options: ConfigOptions = {\n  path: './.env',\n  defaults: './.env.defaults'\n}\n\nconfig(options)\n```\n\n##### CLI\nYou can also call this module directly when using the node executable.\nSo, for example if you are running a custom script with node and you want to load your environment variables you can do the following `node --import dotenv-defaults/config your-script.js`. (_When using this method, please make sure that you have installed dotenv-defaults with npm or yarn in the same directory_)\n\n> **Note:** For Node.js versions that don't support `--import`, you can use `node --loader dotenv-defaults/config your-script.js`\n\n### Differences\n\nThe only thing to note is that the original module supported an `options` argument in the `config` function.\n\nThis module supports that as well, but there is an added `defaults` property that can allow you to define where that file is located. An example is shown below:\n\n```js\n// ESM\nimport { config } from 'dotenv-defaults'\n\n// all of these are the default values...\nconfig({\n  path: './.env',\n  encoding: 'utf8',\n  defaults: './.env.defaults' // This is new\n})\n```\n\n### License\n\nMIT\n","publish_time":1770002324179,"_cnpm_publish_time":1770002324179,"dist-tags":{"latest":"6.0.0"}}