{"name":"snyk-config","description":"Config setup for snyk shared across projects","main":"lib/index.js","scripts":{"test":"node test/*.test.js --afoo --azoo='true' | tap-spec","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"keywords":["config"],"author":{"name":"Remy Sharp"},"license":"Apache-2.0","devDependencies":{"semantic-release":"^6.3.6","tap-spec":"^2.2.2","tape":"^4.0.1"},"dependencies":{"debug":"^2.2.0","nconf":"^0.7.2","path-is-absolute":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/snyk/config.git"},"version":"2.0.0","gitHead":"62845141af3ae72fa76458d7d5a6c01b54205158","bugs":{"url":"https://github.com/snyk/config/issues"},"homepage":"https://github.com/snyk/config#readme","_id":"snyk-config@2.0.0","_shasum":"7a8ec2c7ddf0ad72539054ee1e79dd6447c41d7d","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.1","_npmUser":{"name":"snyk-admin","email":"npm-admin@snyk.io"},"dist":{"shasum":"7a8ec2c7ddf0ad72539054ee1e79dd6447c41d7d","tarball":"http://registry-npm.ywwl.com/snyk-config/download/snyk-config-2.0.0.tgz","fileCount":18,"unpackedSize":10931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3zXECRA9TVsSAnZWagAALJ0P+wZjfFNBFYb+kfXvjheG\neGadrmxBlfo4x1q2WlCOkza+cdmZUwk+Eh7K++kWV4CA34tCC06fwOb5IQZA\nTrjEPGDe4z4+WpbbNwSjQ67bS4aMridFmvLBUWogLrLDgG6BBuGtgFHT+cYt\nQLUzRMBN3e//aQFRbSR7jyI1847Ue4Dpu689NM6MQzwGjQSz3x/j6zf+Kbma\nlB3cHcaKQnfMhXChnkBleK4GswfiXXHKHA9drbGBuf1y+dx8Majr7bX9o0wK\nhqekeMXU78Jg/5tNw0113gO1Pw0HShnX0+8Esxqi4hDAB3LoN9XnEdMoiGrZ\nWgvkNP10zaW1hO+42JF3v08f+Xlsh0K4mSx3i/RYJPy/6eg1oDhHRDj5uaJJ\nTpCJEdiuyK55MNvM+UE3k1PFAgyfESWZxs1s/5vl1oj6nYG5uh2E0yC1xS3y\nc3zTEJjEKtkwIT/dRHXGJUTm/3QMm0y3IjQnk3gCz+KFa2Z45vXONdDipweU\nSEr2hUIA+b+hmnYSTMuw0IhmUnd03mmjgX3eob7mEwnj6aeDGXkwONLPurd/\nJaun1wueYZ/AE5ZNvm9nAP3z1bxLffrtFlR5SFLOtEt25c54FCY3rSWwHNpt\nR8kvhfOrfvuE/WAoHF9sdtC3kFjp07ziPNKiDL2aQ56Owf4Rk48p0QkwbjVm\nfgu6\r\n=UUOu\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-mSRYzeCrq3NVxhktUMYOReQb/JrHM2ZTlR+mwhlyMrfE/KZ4A0lX8nqbg/CwQy+lA+aCI+FNoseJ80Yi12qLMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtMbeMBcRSHA336NQO7SjUIg3Vl/pCIJkBp0FEo8B5rAiEAuA6skM6yoOk3RxCF+19DG/Vq7vwwan/G9U/ALp70Dn8="}],"size":4372,"noattachment":false,"key":"/snyk-config/-/snyk-config-2.0.0.tgz"},"maintainers":[{"email":"admin+snyk@snyk.io","name":"snyk-admin"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snyk-config_2.0.0_1524577732313_0.973621485943893"},"_hasShrinkwrap":false,"readme":"# snyk-config\n\nLoads the configuration for your module.\n\n\n## Usage\n\nAlthough you can require this module directly, it's recommended you create your\nown `config.ts` file that can be cached by the require system and called *without* a path:\n\n```typescript\n// config.ts\nimport { loadConfig } from 'snyk-config';\nexport const config = loadConfig('<directory with config files>');\n\n// in app.ts\nimport { config } from './config';\n\n// in foo.ts\nimport { config } from './config'; // matches config in app.ts\n```\n\n\n## Method\n\nThe config loader will look for the following values in order of priority,\nspecifically, if a property appears in multiple layers of config (below) the\nfirst found is used:\n\n- process environment values prefixed with `SNYK_`\n- process arguments\n- a `config.secret.json` file in the path specified by:\n   * the `secretConfig` option, or\n   * the environment variable `CONFIG_SECRET_FILE`, or\n   * in the specified config directory\n- a `config.${SERVICE_ENV}.json` file in the specified config directory,\n   * where `SERVICE_ENV` defaults to `local`, if not set\n- a `config.default.json` file in the specified config directory\n\n\n## Example\n\n### config.local.json\n\n```json\n{\n  \"from\": \"file\"\n}\n```\n\n\n### app.js\n\n```typescript\nimport { loadConfig } from 'snyk-config';\n// as we're in the same directory as the config.local.json, there's no arg\nconst config = loadConfig();\nconsole.log(config);\n```\n\n\n### cli\n\n```shell\n$ SNYK_from=cli node app.js\n=> { from: \"cli\" }\n```\n\n\n## Notes\n\n* Values read from the environment or from the process arguments will *always* be `strings`\n  or `boolean`s. This is important to differentiate from values parsed in the config files\n  as these can be `numbers`.\n* Environment property names strip *off* the preceding `SNYK_` string, so `SNYK_foo = 10`\n  becomes `foo = \"10\"`\n* To create a nested object structure from the environment values, use two underscores:\n  `SNYK_foo__bar = 10` becomes `foo = { bar: \"10\" }`\n* By default, environment variable values will not be JSON-parsed.\n  Parsing can be enabled by adding the `parseEnvValues` option, or by setting\n  the `CONFIG_PARSE_ENV_VALUES` environment variable.\n","publish_time":1524577732357,"_cnpm_publish_time":1524577732357,"dist-tags":{"latest":"5.3.0","nconffix":"4.0.0-rc.2"}}