@zkochan/pnpm
Version:
Fast, disk space efficient package manager
122 lines (121 loc) • 10.4 kB
JSON
{
"_args": [
[
{
"raw": "dotenv@^4.0.0",
"scope": null,
"escapedName": "dotenv",
"name": "dotenv",
"rawSpec": "^4.0.0",
"spec": ">=4.0.0 <5.0.0",
"type": "range"
},
"/home/zkochan/src/pnpm/packages/pnpm/node_modules/@zkochan/libnpx"
]
],
"_from": "dotenv@>=4.0.0 <5.0.0",
"_id": "dotenv@4.0.0",
"_inCache": true,
"_location": "/dotenv",
"_nodeVersion": "7.4.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/dotenv-4.0.0.tgz_1483816132917_0.4720889476593584"
},
"_npmUser": {
"name": "maxbeatty",
"email": "max@beatty.me"
},
"_npmVersion": "4.0.5",
"_phantomChildren": {},
"_requested": {
"raw": "dotenv@^4.0.0",
"scope": null,
"escapedName": "dotenv",
"name": "dotenv",
"rawSpec": "^4.0.0",
"spec": ">=4.0.0 <5.0.0",
"type": "range"
},
"_requiredBy": [
"/@zkochan/libnpx"
],
"_resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz",
"_shasum": "864ef1379aced55ce6f95debecdce179f7a0cd1d",
"_shrinkwrap": null,
"_spec": "dotenv@^4.0.0",
"_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/@zkochan/libnpx",
"author": {
"name": "scottmotte"
},
"bugs": {
"url": "https://github.com/motdotla/dotenv/issues"
},
"dependencies": {},
"description": "Loads environment variables from .env file",
"devDependencies": {
"babel": "5.8.23",
"coveralls": "^2.11.9",
"lab": "11.1.0",
"semver": "5.3.0",
"should": "11.1.1",
"sinon": "1.17.6",
"standard": "8.4.0",
"standard-markdown": "2.2.0"
},
"directories": {},
"dist": {
"shasum": "864ef1379aced55ce6f95debecdce179f7a0cd1d",
"tarball": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz"
},
"engines": {
"node": ">=4.6.0"
},
"gitHead": "fdd0923e82e12a6e29b65898990201857141e75d",
"homepage": "https://github.com/motdotla/dotenv#readme",
"keywords": [
"dotenv",
"env",
".env",
"environment",
"variables",
"config",
"settings"
],
"license": "BSD-2-Clause",
"main": "lib/main.js",
"maintainers": [
{
"name": "jcblw",
"email": "jacoblowe2.0@gmail.com"
},
{
"name": "maxbeatty",
"email": "max@beatty.me"
},
{
"name": "motdotla",
"email": "mot@mot.la"
},
{
"name": "scottmotte",
"email": "scott@scottmotte.com"
}
],
"name": "dotenv",
"optionalDependencies": {},
"readme": "# dotenv\n\n<img src=\"https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.png\" alt=\"dotenv\" align=\"right\" />\n\nDotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](http://12factor.net/config) methodology.\n\n[](https://travis-ci.org/motdotla/dotenv)\n[](https://www.npmjs.com/package/dotenv)\n[](https://github.com/feross/standard)\n[](https://coveralls.io/github/motdotla/dotenv?branch=coverall-intergration)\n\n## Install\n\n```bash\nnpm install dotenv --save\n```\n\n## Usage\n\nAs early as possible in your application, require and configure dotenv.\n\n```javascript\nrequire('dotenv').config()\n```\n\nCreate a `.env` file in the root directory of your project. Add\nenvironment-specific variables on new lines in the form of `NAME=VALUE`.\nFor example:\n\n```\nDB_HOST=localhost\nDB_USER=root\nDB_PASS=s1mpl3\n```\n\nThat's it.\n\n`process.env` now has the keys and values you defined in your `.env` file.\n\n```javascript\nvar db = require('db')\ndb.connect({\n host: process.env.DB_HOST,\n username: process.env.DB_USER,\n password: process.env.DB_PASS\n})\n```\n\n### Preload\n\nIf you are using iojs-v1.6.0 or later, you can use the `--require` (`-r`) command line option to preload dotenv. By doing this, you do not need to require and load dotenv in your application code.\n\n\n```bash\n$ node -r dotenv/config your_script.js\n```\n\nThe configuration options below are supported as command line arguments in the format `dotenv_config_<option>=value`\n\n```bash\n$ node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/your/env/vars\n```\n\n## Config\n\n_Alias: `load`_\n\n`config` will read your .env file, parse the contents, assign it to\n[`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env),\nand return an Object with a _parsed_ key containing the loaded content or an _error_ key if it failed. \nYou can additionally, pass options to `config`.\n\n### Options\n\n#### Path\n\nDefault: `.env`\n\nYou can specify a custom path if your file containing environment variables is\nnamed or located differently.\n\n```js\nrequire('dotenv').config({path: '/custom/path/to/your/env/vars'})\n```\n\n#### Encoding\n\nDefault: `utf8`\n\nYou may specify the encoding of your file containing environment variables\nusing this option.\n\n```js\nrequire('dotenv').config({encoding: 'base64'})\n```\n\n## Parse\n\nThe engine which parses the contents of your file containing environment\nvariables is available to use. It accepts a String or Buffer and will return\nan Object with the parsed keys and values.\n\n```js\nvar dotenv = require('dotenv')\nvar buf = new Buffer('BASIC=basic')\nvar config = dotenv.parse(buf) // will return an object\nconsole.log(typeof config, config) // object { BASIC : 'basic' }\n```\n\n### Rules\n\nThe parsing engine currently supports the following rules:\n\n- `BASIC=basic` becomes `{BASIC: 'basic'}`\n- empty lines are skipped\n- lines beginning with `#` are treated as comments\n- empty values become empty strings (`EMPTY=` becomes `{EMPTY: ''}`)\n- single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: \"quoted\"}`)\n- new lines are expanded if in double quotes (`MULTILINE=\"new\\nline\"` becomes\n\n```\n{MULTILINE: 'new\nline'}\n```\n- inner quotes are maintained (think JSON) (`JSON={\"foo\": \"bar\"}` becomes `{JSON:\"{\\\"foo\\\": \\\"bar\\\"}\"`)\n\n## FAQ\n\n### Should I commit my `.env` file?\n\nNo. We **strongly** recommend against committing your `.env` file to version\ncontrol. It should only include environment-specific values such as database\npasswords or API keys. Your production database should have a different\npassword than your development database.\n\n### Should I have multiple `.env` files?\n\nNo. We **strongly** recommend against having a \"main\" `.env` file and an \"environment\" `.env` file like `.env.test`. Your config should vary between deploys, and you should not be sharing values between environments.\n\n> In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.\n>\n> – [The Twelve-Factor App](http://12factor.net/config)\n\n### What happens to environment variables that were already set?\n\nWe will never modify any environment variables that have already been set. In particular, if there is a variable in your `.env` file which collides with one that already exists in your environment, then that variable will be skipped. This behavior allows you to override all `.env` configurations with a machine-specific environment, although it is not recommended.\n\nIf you want to override `process.env` you can do something like this:\n\n```javascript\nconst fs = require('fs')\nconst dotenv = require('dotenv')\nconst envConfig = dotenv.parse(fs.readFileSync('.env.override'))\nfor (var k in envConfig) {\n process.env[k] = envConfig[k]\n}\n```\n\n### Can I customize/write plugins for dotenv?\n\nFor `dotenv@2.x.x`: Yes. `dotenv.config()` now returns an object representing\nthe parsed `.env` file. This gives you everything you need to continue\nsetting values on `process.env`. For example:\n\n```js\nvar dotenv = require('dotenv')\nvar variableExpansion = require('dotenv-expand')\nconst myEnv = dotenv.config()\nvariableExpansion(myEnv)\n```\n\n### What about variable expansion?\n\nFor `dotenv@2.x.x`: Use [dotenv-expand](https://github.com/motdotla/dotenv-expand).\n\nFor `dotenv@1.x.x`: We haven't been presented with a compelling use case for expanding variables and believe it leads to env vars that are not \"fully orthogonal\" as [The Twelve-Factor App](http://12factor.net/config) outlines.<sup>[[1](https://github.com/motdotla/dotenv/issues/39)][[2](https://github.com/motdotla/dotenv/pull/97)]</sup> Please open an issue if you have a compelling use case.\n\n## Contributing Guide\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Change Log\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n## License\n\nSee [LICENSE](LICENSE)\n\n## Who's using dotenv\n\nHere's just a few of many repositories using dotenv:\n\n* [jaws](https://github.com/jaws-framework/jaws-core-js)\n* [node-lambda](https://github.com/motdotla/node-lambda)\n* [resume-cli](https://www.npmjs.com/package/resume-cli)\n* [phant](https://www.npmjs.com/package/phant)\n* [adafruit-io-node](https://github.com/adafruit/adafruit-io-node)\n* [mockbin](https://www.npmjs.com/package/mockbin)\n* [and many more...](https://www.npmjs.com/browse/depended/dotenv)\n\n## Go well with dotenv\n\nHere's some projects that expand on dotenv. Check them out.\n\n* [require-environment-variables](https://github.com/bjoshuanoah/require-environment-variables)\n* [dotenv-safe](https://github.com/rolodato/dotenv-safe)\n* [envalid](https://github.com/af/envalid)\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/motdotla/dotenv.git"
},
"scripts": {
"lint": "standard",
"lint-md": "standard-markdown",
"postlint": "npm run lint-md",
"pretest": "npm run lint",
"test": "lab test/* -r lcov | coveralls"
},
"version": "4.0.0"
}