{"name":"snyk-config","description":"Config setup for snyk shared across projects","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","watch":"tsc -w","prepare":"npm run build","lint":"eslint 'lib/**/*.?s'","test":"node test/*.test.js --afoo --azoo='true' | tap-spec","format":"prettier --write '{lib,test}/**/*.?s'"},"keywords":["config"],"author":{"name":"Remy Sharp"},"license":"Apache-2.0","devDependencies":{"@types/lodash":"^4.14.147","@types/nconf":"^0.10.0","@types/node":"^6.14.9","@typescript-eslint/eslint-plugin":"^2.7.0","@typescript-eslint/parser":"^2.7.0","eslint":"^6.6.0","eslint-config-prettier":"^6.5.0","prettier":"^1.19.1","tap-spec":"^5.0.0","tape":"^4.11.0","typescript":"^3.7.2"},"dependencies":{"debug":"^4.1.1","lodash":"^4.17.15","nconf":"^0.10.0"},"repository":{"type":"git","url":"git+https://github.com/snyk/config.git"},"version":"3.0.0","gitHead":"b4b49126ab80a909c653dc99c7ccd73e86b80676","bugs":{"url":"https://github.com/snyk/config/issues"},"homepage":"https://github.com/snyk/config#readme","_id":"snyk-config@3.0.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-sXjd7gUqPTmgkhtLowFkFU5J4xyS7tDIRUbHmpW/dvTjgmiH0ujobJzSdaim4W6pbiIf4snkGJsvHM3/wmdR5w==","shasum":"7e77cd5c7710db0716330097ad63bc3469c3b530","tarball":"http://registry-npm.ywwl.com/snyk-config/download/snyk-config-3.0.0.tgz","fileCount":30,"unpackedSize":24513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1SBICRA9TVsSAnZWagAA72gP/jubum/qvZHNbdzje6Aq\nafSxrbUo/9Vkl/YyAnHHqaoEDRkVcAdlBJLIIfzNWMtNtGMj8QUJEqtEL83f\no5Ce0dqOKfnnIjQG7cnTKaA4k6t4wNA6Cd0aIbA3POh+V312/oxVN4IkhPbM\naDn9LEcLSInjds/lbCs4pltf6duKHalbHMwmUNfP18LW4wUBssD4xTpYhboM\nxXJRRsr2zSqsujVDGaWcthS9J/TEsP2uNR8Gz7OHV4rBkF5565rh8dR2b9Z+\n+Co5SRopMbFl6VrKP5xZTn3nGTT872QK3VbteD3b5uckSdjzlurmzNcl+Xvv\nI/wbiSoXKf1XOcywjEUPYPLayl/L3J0tuDG8jvOm1QtJPh3HL6fS1FyJXZJT\nM7L9fcFbSbUiPzzOBk/vSTSqxjmfadjvnbeJaE5kPYF8Qz9GC0BTf6MiWrFT\nLFEPXk41Rs5VKAdwdDEZUwxFapSOOAOmfccjQdrIKhjijQYLJqwTuI5oZgTP\nIL4NkWX8nFTrIu81Q1zA/rpvrjfxTju41AXK0Zamke/1XOUQEQqVIw+VdD2J\nTGuPr1GRna6JGgoQMZsugZ6miDzZ7VRmqSNODhjsAP2QAWR1u5n7Ny8eSBVC\nV9/4HPOXrqzqpiU9plCoodAp3LhXkb7EHoJRfkeIJPAHJ8F2CqHuHFigU6W7\nOyeD\r\n=ixaF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZNbWD10yqrGOmU2xZ7I1O6O31EyKTOOOoWXCHvYHq9AiEAuAWMPEgIbKDNAJek2HcaR+RQOevgEPqFyPm1AnXnuTw="}],"size":8490,"noattachment":false,"key":"/snyk-config/-/snyk-config-3.0.0.tgz"},"maintainers":[{"email":"admin+snyk@snyk.io","name":"snyk-admin"}],"_npmUser":{"name":"snyk-admin","email":"npmjs+snyk-admin@snyk.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snyk-config_3.0.0_1574248518905_0.44551334565134404"},"_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":1574248519050,"_cnpm_publish_time":1574248519050,"dist-tags":{"latest":"5.3.0","nconffix":"4.0.0-rc.2"}}