{"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":{"tap-spec":"^5.0.0","tape":"^4.9.2"},"dependencies":{"debug":"^3.1.0","lodash":"^4.17.14","nconf":"^0.10.0"},"repository":{"type":"git","url":"git+https://github.com/snyk/config.git"},"version":"2.2.2","gitHead":"468936192b5febc65b8a22c1c4cdaecefb6bec44","bugs":{"url":"https://github.com/snyk/config/issues"},"homepage":"https://github.com/snyk/config#readme","_id":"snyk-config@2.2.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ud1UJhU5b3z2achCVbXin6m3eeESvJTn9hBDYjp5BafI+1ajOJt0LnUB9+SAZ3CnQIK90PUb/3nSx0xjtda7sA==","shasum":"6122e98134df8d0831bdb0a09bb0ce2bab8146b6","tarball":"http://registry-npm.ywwl.com/snyk-config/download/snyk-config-2.2.2.tgz","fileCount":17,"unpackedSize":11967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLIj3CRA9TVsSAnZWagAAimcP+QFsZVelzm61zhSjKoV3\ncXR5o0haUfFsMN87546J1AuaI85b6slI5r0C6G81gugDlOgYydTo4cr+/Gpj\nJ6w2/zX8a7v6+Y3ahpILuBrtovT4+YxfFzfI2Hby/YMPvkHlueIfiMFk6RiI\nem7JSHTYkqPEOb78r2Sd6C5wZ7WEKBMwI+PVxnDZG2Lt9JnKkfpQsapozW60\nz01g3yigq9YVLrRvKi9K+lqwiua5+lUyzwd2gv8AiXPFH+9ANZRP0ucJFEKe\niWinkCY7bzmBLUsA/9h07Rt2f+MHvA4lqNm+O7T9KV648sSjM+kcoFcxK9OL\n2rqokUOmcOsLbfDBQDGcyEQfm0s+9BiPyyol7OPpfj9d+gI+DrDiIJpH3hxn\nde3NzLh2IPFdji/R2wxBKDijpeKzaZNJ0lb1GkpF0KpaqZR7vSfqTN5vpbou\nLNGYjKNutGzvktm4PtRpas1G6lH98VySBadC+bPLhcojeim6Pq3kwgSgZPGY\n1HMfpUXwrfzHzYhb9Zn8Gp5Wy9kGUtmHqb0Vm1RebW4r391zD+ZzIjXgwqdi\nTZ5BpKbFwV264wi6ZA8CY/cKcm9pHG/eAp5OfVF9gVgbc+nahEJar20knh1p\nXP1Aqy9BIwCCQ/d1eZ5r65qm3xcysNki9wwoQQXSgZhVYX8EhNGFHJu3tGDG\nodPR\r\n=F8wm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6i4GL9zUWsDYIa1FEzxSFNZ1k1eeZaIiAelD14XFgYwIhAMMU/n5+gnZKK7aYaskSJKVJV2o4yqteJ40qs+9NGlil"}],"size":4538,"noattachment":false,"key":"/snyk-config/-/snyk-config-2.2.2.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_2.2.2_1563199734702_0.07034622338418717"},"_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":1563199734837,"_cnpm_publish_time":1563199734837,"dist-tags":{"latest":"5.3.0","nconffix":"4.0.0-rc.2"}}