{"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":"jest","format":"prettier --write '{lib,test}/**/*.?s'"},"keywords":["config"],"author":{"name":"Remy Sharp"},"license":"(Apache-2.0 AND MIT)","devDependencies":{"@types/jest":"^26.0.20","@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","jest":"^26.6.3","jest-junit":"^12.0.0","prettier":"^1.19.1","ts-jest":"^26.4.4","typescript":"^3.7.2"},"dependencies":{"async":"^3.2.0","debug":"^4.1.1","lodash.merge":"^4.6.2","minimist":"^1.2.5"},"repository":{"type":"git","url":"git+https://github.com/snyk/config.git"},"version":"5.1.0","gitHead":"e4aa63584df624db1b09ee64535e24ea6de5a3f6","bugs":{"url":"https://github.com/snyk/config/issues"},"homepage":"https://github.com/snyk/config#readme","_id":"snyk-config@5.1.0","_nodeVersion":"16.14.2","_npmVersion":"6.14.16","dist":{"integrity":"sha512-wqVMxUGqjjHX+MJrz0WHa/pJTDWU17aRv6cnI/6i7cq93J3TkkJZ8sjgvwCgP8cWX5wTHIlRuMV+IAd59K4X/g==","shasum":"d725739ede0732a7db13be4e120c90b39e496ab7","tarball":"http://registry-npm.ywwl.com/snyk-config/download/snyk-config-5.1.0.tgz","fileCount":66,"unpackedSize":166010,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN35Fajv7CdvfBBppySfzAxQ+pH4EBCPNhMgwCmor4MAIhAPHa9P3QpzbDQNqs9hejXnHcEIyPoirhWh4jNXKSKSE7"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV+qTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqolw/+KCMpnuqSGEWSfCn5+UqkNggyHYsX78tQA/YzN/2NcDCFJVWm\r\ncWa3B/dY776mv+oZMocko6clWVfAdA85fXPJTdj/jqiAIrL3Raya1t2dR1cM\r\na/JpX3CUMPmzGBWdsqGoBcpNdw4UAyHnDqJ28Kzjaplvm1F4jxZE0Kmn2WsG\r\nL/Nhzo+pYFP3fYofUmW2fAOgL/mf7oSPvxa64zfEsc4PmXnF0VXLRv59WJDA\r\nHT8frLxrRitLKwP+HiN+KhrII1A6LJly2T4ITuilvFbSUaRy8PsCiyDjdnCC\r\n3h0zpzXAx6bzxDq71mnPob7tNl9pPZVtgYBMCLWwVSM28gV471SjVqUMPoW6\r\ndXYSd60C+f05WHcd64PnRif86l6qWYzKGCq6/gdYmlg/Q6t2TpuoTdi42mUJ\r\nSqE+RCHri9qgxLseukDXzmwOp8jpQzcelML4XN6IN2X1akrFK03usXQm+b4O\r\nPUAzOZvkIPWw6rzNqV3EUldXivBxKGP8j18NRKTwn2A4TRRDjiK2h9NZNfKc\r\nc3Gsznmzft1XgrFRnAsQMP2ZSHc/0qxvMz6l/9HTsU4mbsFySym8HXttQ8xt\r\nMkcQes1N7ERq+jLtMkdbp3OOann6TDvXyeEvE6h9O1oQ2iFcuDpVzN4gwNlW\r\nNIHmTb/8B1nF2tD+3as9DnZ6mf69lgYcZKM=\r\n=jwEj\r\n-----END PGP SIGNATURE-----\r\n","size":40904,"noattachment":false,"key":"/snyk-config/-/snyk-config-5.1.0.tgz"},"_npmUser":{"name":"snyk-admin","email":"npmjs+snyk-admin@snyk.io"},"directories":{},"maintainers":[{"name":"snyk-admin","email":"npmjs+snyk-admin@snyk.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snyk-config_5.1.0_1649928851075_0.8137719097421725"},"_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":1649928851239,"_cnpm_publish_time":1649928851239,"dist-tags":{"latest":"5.3.0","nconffix":"4.0.0-rc.2"}}