{"_id":"@bristolinfotech/dotenv-tiered","_rev":"4-b8bd6238adc7d2b0a9336b91e32a3f86","name":"@bristolinfotech/dotenv-tiered","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"@bristolinfotech/dotenv-tiered","description":"dotenv-tiered","version":"0.0.1","authors":["Carl Craig <carl@bristolinfotech.com>","Loki Wijnen <loki@bristolinfotech.com>"],"dependencies":{"dotenv":"^5.0.1","dotenv-expand":"^4.2.0","fs-extra":"^5.0.0","in-publish":"^2.0.0","tslib":"^1.8.0"},"devDependencies":{"@bristolinfotech/tslint-rules":"^1.0.0","@types/fs-extra":"^5.0.1","concurrently":"^3.5.0","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","watch-cli":"^0.2.2"},"files":["esm","cjs","package.json","README.md","LICENSE"],"license":"MIT","main":"cjs/index.js","module":"esm/index.js","private":false,"repository":{"type":"git","url":"https://github.com/bristolinfotech/dotenv-tiered.git"},"scripts":{"build":"yarn lint && yarn build:cjs && yarn build:esm","build:cjs":"rimraf cjs && tsc --outDir cjs","build:esm":"rimraf esm && tsc --outDir esm --target es6 --module esnext","lint":"tslint -t stylish -c tslint.json -p tsconfig.json 'src/**/*.ts' 'src/**/*.tsx'","prepare":"in-publish && yarn build || not-in-publish","start":"concurrently --kill-others --names \"tsc,tslint\" -c \"bold.blue,magenta.bold\" \"yarn watch:typescript\" \"yarn watch:lint\"","watch:lint":"watch -p \"src/**/*.ts\" -p \"src/**/*.tsx\" -c \"yarn lint\"","watch:typescript":"tsc --watch --outDir esm --target es6 --module esnext"},"sideEffects":false,"types":"esm/index.d.ts","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2018 Bristol Info Tech Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@bristolinfotech/dotenv-tiered@0.0.1","dist":{"shasum":"a8d6559260164bd1012065088d4e972d4ef36e47","tarball":"https://registry.npmjs.org/@bristolinfotech/dotenv-tiered/-/dotenv-tiered-0.0.1.tgz","fileCount":14,"unpackedSize":13941,"integrity":"sha512-GU8+QdGvEkqe87VyjXXuSH/6Z18KmJtC5It2AasdXNTy8Q2ZR4tphzkmLl1A3kT6tIENGFyWijNwVn0CyeqjOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsfCnh8QonMSowLxDKtg/wVjqKcj6v8y8V6DAyq9/g4wIhAJ4/e72azWdI9j3a9CUAUDKk2EPnv1KcaYwaerlrvSTB"}]},"maintainers":[{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},{"name":"lokiwijnen","email":"npmjs@kloki.com"}],"_npmUser":{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dotenv-tiered_0.0.1_1522460741490_0.14255810842012773"},"_hasShrinkwrap":false},"1.0.0":{"private":false,"name":"@bristolinfotech/dotenv-tiered","version":"1.0.0","description":"dotenv-tiered","license":"MIT","authors":["Carl Craig <carl@bristolinfotech.com>","Loki Wijnen <loki@bristolinfotech.com>"],"repository":{"type":"git","url":"https://github.com/bristolinfotech/dotenv-tiered.git"},"main":"lib/index.js","types":"lib/index.d.ts","sideEffects":false,"files":["lib","package.json","README.md","LICENSE"],"scripts":{"prepare":"in-publish && yarn build || not-in-publish","build":"rimraf lib && yarn lint && yarn build:typescript && yarn build:babel","build:typescript":"tsc --preserveWatchOutput --emitDeclarationOnly --pretty","build:babel":"babel src --out-dir lib --extensions \".ts,.tsx\"","start":"concurrently --kill-others --names \"tsc,babel,tslint\" -c \"bold.blue,bold.cyan,magenta.bold\" \"yarn watch:typescript\" \"yarn watch:babel\" \"yarn watch:lint\"","watch:typescript":"tsc --preserveWatchOutput --emitDeclarationOnly --pretty --watch","watch:babel":"babel src --out-dir lib --extensions \".ts,.tsx\" --watch --verbose","watch:lint":"chokidar 'src/**/*.ts' 'src/**/*.tsx' -c 'yarn lint' --initial --silent","lint":"tslint -t codeFrame -c tslint.json -p tsconfig.json 'src/**/*.ts' 'src/**/*.tsx' -e 'src/types/**/*'"},"dependencies":{"dotenv":"^5.0.1","dotenv-expand":"^4.2.0","fs-extra":"^5.0.0","in-publish":"^2.0.0","tslib":"^1.8.0"},"devDependencies":{"@babel/cli":"7.0.0-beta.44","@babel/core":"7.0.0-beta.44","@babel/plugin-proposal-class-properties":"7.0.0-beta.44","@babel/plugin-proposal-object-rest-spread":"7.0.0-beta.44","@babel/preset-env":"7.0.0-beta.44","@babel/preset-typescript":"7.0.0-beta.44","@bristolinfotech/tslint-rules":"^1.0.0","@types/fs-extra":"^5.0.1","chokidar-cli":"^1.2.0","concurrently":"^3.5.0","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.8.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2018 Bristol Info Tech Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@bristolinfotech/dotenv-tiered@1.0.0","dist":{"shasum":"d73f6e682cf25dbb5adf43502b5b0f701c574497","tarball":"https://registry.npmjs.org/@bristolinfotech/dotenv-tiered/-/dotenv-tiered-1.0.0.tgz","fileCount":9,"unpackedSize":8724,"integrity":"sha512-82LzAJyKEk5PH4d9OkT/J4QBvI5SY52pUtnSvTmedBaF4tADgkmB06h9ETaXdzO44sCori+gNMhLFoHR/kLRSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcw4CrSbiEGqmUx+L57UcMM6LSPJdYhddH50hG3XWm+QIgL8RMBXkozyMhk+ArIkYj8c4AuDw+KLNKWh0w4M4384g="}]},"maintainers":[{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},{"name":"lokiwijnen","email":"npmjs@kloki.com"}],"_npmUser":{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dotenv-tiered_1.0.0_1522859277958_0.384851781047872"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-31T01:45:41.489Z","0.0.1":"2018-03-31T01:45:41.570Z","modified":"2022-06-12T15:30:16.163Z","1.0.0":"2018-04-04T16:27:58.054Z"},"maintainers":[{"name":"carlcraig","email":"carlcraig.threeceestudios@gmail.com"},{"name":"lokiwijnen","email":"npmjs@kloki.com"}],"description":"dotenv-tiered","repository":{"type":"git","url":"https://github.com/bristolinfotech/dotenv-tiered.git"},"license":"MIT","readme":"dotenv-tiered\n=============\n\n> loads a tiered dotenv setup based on current node environment\n\nOverview\n--------\n\nThis package works with a tiered `.env` file project setup (similar to create-react-app)\n\nExample `.env` structure\n\n```js\n.env                     // checked into vcs\n.env.local               // ignored from vcs\n\n.env.development         // checked into vcs\n.env.development.local   // ignored from vcs\n\n.env.production          // checked into vcs\n.env.production.local    // checked into vcs\n\n.env.test                // checked into vcs\n.env.test.local          // checked into vcs\n```\n\nThe `.env` files will load in the following order\n\n1. `.env.{NODE_ENV}.local`\n2. `.env.{NODE_ENV}`\n3. `.env.local`\n4. `.env`\n\nThe dotenv files will only load if they exist (so you only need to create the variations you need)\n\nThis package uses [dotenv](https://github.com/motdotla/dotenv) and [dotenv-expand](https://github.com/motdotla/dotenv-expand) behind the scenes.\n\nInstallation\n------------\n\n```\nyarn add @bristolinfotech/dotenv-tiered\n```\n\nBasic Usage\n-----------\n\nTo load `.env` without configuration, add the following as early as possible:\n\n```js\n// for es modules\nimport '@bristolinfotech/dotenv-tiered/lib/load';\n```\n\nExample programmatic usage:\n\n```js\nimport {\n  loadDotenv,\n  loadDotenvSync,\n  getFilteredEnv,\n  getStringifiedEnv,\n  getStringifiedFilteredEnv,\n} from '@bristolinfotech/dotenv-tiered';\n\n// load dotenv files sync\nloadDotenvSync(\n  '.env', // the path to your base .env file e.g. ./some-folder/.env\n  {\n    expand: true, // enable/disable dotenv-expand\n    suffix: '.local', // the suffix to use for local non vcs .env files\n  }\n);\n\n// load dotenv files async\nloadDotenv(); // same args as sync, returns a promise\n\n// get all env variables starting with FOO_, BAR_ or BAZ_\nconst filteredEnv = getFilteredEnv([\n  /^FOO_/i,\n  /^BAR_/i,\n  /^BAZ_/i,\n]);\n\n// stringify env variables ready for systems like webpack DefinePlugin\nconst stringifiedEnv = getStringifiedEnv(filteredEnv); // can pass env here, defaults to process.env\n\n// get stringified env starting with FOO_, BAR_ or BAZ_\nconst filteredStringifiedEnv = getStringifiedFilteredEnv([\n  /^FOO_/i,\n  /^BAR_/i,\n  /^BAZ_/i,\n]);\n```\n","readmeFilename":"README.md"}