{"_id":"pkg-conf","_rev":"4665452","name":"pkg-conf","description":"Get namespaced config from the closest package.json","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-10T22:38:18.000Z","created":"2015-09-02T10:27:59.319Z","5.0.0":"2023-11-04T09:00:47.747Z","4.0.0":"2021-09-02T16:09:35.810Z","3.1.0":"2019-04-06T07:05:21.846Z","3.0.0":"2019-03-02T14:12:55.022Z","2.1.0":"2017-12-27T09:21:06.593Z","2.0.0":"2016-10-10T19:25:09.580Z","1.1.3":"2016-05-24T04:00:17.609Z","1.1.2":"2016-03-26T08:46:38.266Z","1.1.1":"2016-01-24T01:30:19.236Z","1.1.0":"2016-01-23T22:49:30.062Z","1.0.1":"2015-09-02T16:44:32.797Z","1.0.0":"2015-09-02T10:27:59.319Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"versions":{"5.0.0":{"name":"pkg-conf","version":"5.0.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","package","config","configuration","object","namespace","namespaced"],"dependencies":{"find-up-simple":"^1.0.0","load-json-file":"^7.0.1"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"fixture":{"foo":true},"types":"./index.d.ts","gitHead":"a23edb79d4874883d4b50be0ee380181b02c915a","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@5.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"23bbcc0f5ada4255803007754009e5b00c51afe0","size":3034,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-conf_5.0.0_1699088447572_0.3296340360715455"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T09:00:47.747Z","publish_time":1699088447747,"_source_registry_name":"default","deprecated":"Renamed to package-config","_cnpm_publish_time":1699088447747},"4.0.0":{"name":"pkg-conf","version":"4.0.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","package","config","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^6.0.0","load-json-file":"^7.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"fixture":{"foo":true},"gitHead":"8179ed39498c7c49f5be79fcf9f12aa5814b5519","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@4.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"63ace00cbacfa94c2226aee133800802d3e3b80c","size":3034,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-conf_4.0.0_1630598975690_0.4470945878422312"},"_hasShrinkwrap":false,"publish_time":1630598975810,"_cnpm_publish_time":1630598975810},"3.1.0":{"name":"pkg-conf","version":"3.1.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^3.0.0","load-json-file":"^5.2.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"fixture":{"foo":true},"gitHead":"50a682621fb0b429e7e471191df276e34a136d18","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@3.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d9f9c75ea1bae0e77938cde045b276dac7cc69ae","size":3305,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-conf_3.1.0_1554534321667_0.7685623035085318"},"_hasShrinkwrap":false,"publish_time":1554534321846,"_cnpm_publish_time":1554534321846},"3.0.0":{"name":"pkg-conf","version":"3.0.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^3.0.0","load-json-file":"^5.2.0"},"devDependencies":{"ava":"^1.2.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"fixture":{"foo":true},"gitHead":"dfe3280d0b3924b3ec6b022866568658c993c083","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@3.0.0","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"41f836458fb83b080e08e62b2d63a68aa8c436df","size":3182,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-conf_3.0.0_1551535974836_0.37506960462023864"},"_hasShrinkwrap":false,"publish_time":1551535975022,"_cnpm_publish_time":1551535975022},"2.1.0":{"name":"pkg-conf","version":"2.1.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^2.0.0","load-json-file":"^4.0.0"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"a57403234f29ff56d890c06d4048a24e51708bfe","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@2.1.0","_shasum":"2126514ca6f2abfebd168596df18ba57867f0058","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2126514ca6f2abfebd168596df18ba57867f0058","size":2817,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-conf-2.1.0.tgz_1514366465737_0.7428827714174986"},"directories":{},"publish_time":1514366466593,"_hasShrinkwrap":false,"_cnpm_publish_time":1514366466593},"2.0.0":{"name":"pkg-conf","version":"2.0.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^2.0.0","load-json-file":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"fixture":{"foo":true},"gitHead":"9c1bba03f9fdd9449e9218eb03d1edc86acc0b28","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@2.0.0","_shasum":"071c87650403bccfb9c627f58751bfe47c067279","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"071c87650403bccfb9c627f58751bfe47c067279","size":2832,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pkg-conf-2.0.0.tgz_1476127507292_0.7264729030430317"},"directories":{},"publish_time":1476127509580,"_cnpm_publish_time":1476127509580,"_hasShrinkwrap":false},"1.1.3":{"name":"pkg-conf","version":"1.1.3","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","load-json-file":"^1.1.0","object-assign":"^4.0.1","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"e1030ef1a395162399987b1c92a1f76b9bfe600f","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.1.3","_shasum":"378e56d6fd13e88bfb6f4a25df7a83faabddba5b","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"378e56d6fd13e88bfb6f4a25df7a83faabddba5b","size":2502,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.1.3.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pkg-conf-1.1.3.tgz_1464062415515_0.5557844769209623"},"directories":{},"publish_time":1464062417609,"_cnpm_publish_time":1464062417609,"_hasShrinkwrap":false},"1.1.2":{"name":"pkg-conf","version":"1.1.2","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","load-json-file":"^1.1.0","object-assign":"^4.0.1","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"066eebf23bfb8a40ae6a7c155fa00b5d59417756","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.1.2","_shasum":"e826877a9c15dc7ca9fa06afa38ccd620384e92c","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e826877a9c15dc7ca9fa06afa38ccd620384e92c","size":2495,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.1.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pkg-conf-1.1.2.tgz_1458981997858_0.6328517564106733"},"directories":{},"publish_time":1458981998266,"_cnpm_publish_time":1458981998266,"_hasShrinkwrap":false},"1.1.1":{"name":"pkg-conf","version":"1.1.1","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","object-assign":"^4.0.1","read-pkg":"^1.0.0","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"9bb0bb78f4e6d8b6e14e8ef28b1cfba7305341f6","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.1.1","_shasum":"a3caee3fb9c23ab4abad3baaea02f0001c75f200","_from":".","_npmVersion":"3.6.0","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a3caee3fb9c23ab4abad3baaea02f0001c75f200","size":2320,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1453599019236,"_cnpm_publish_time":1453599019236,"_hasShrinkwrap":false},"1.1.0":{"name":"pkg-conf","version":"1.1.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","object-assign":"^4.0.1","read-pkg":"^1.0.0","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"30b9f0af2ef581fe10bb6c6770726fab5d793ecb","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.1.0","_shasum":"b4b8edd1144e5c9973c61878d4e2c96397250f3d","_from":".","_npmVersion":"3.6.0","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b4b8edd1144e5c9973c61878d4e2c96397250f3d","size":2315,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1453589370062,"_cnpm_publish_time":1453589370062,"_hasShrinkwrap":false},"1.0.1":{"name":"pkg-conf","version":"1.0.1","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","read-pkg":"^1.0.0","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"4b65276fde28f47bbc2ff0c64ede56c2dda1115b","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.0.1","_shasum":"cb88d2459a734c76575e0a78cb812ee2ff8ffa82","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"cb88d2459a734c76575e0a78cb812ee2ff8ffa82","size":2180,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1441212272797,"_cnpm_publish_time":1441212272797,"_hasShrinkwrap":false},"1.0.0":{"name":"pkg-conf","version":"1.0.0","description":"Get namespaced config from the closest package.json","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-conf.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","config","conf","configuration","object","namespace","namespaced"],"dependencies":{"find-up":"^1.0.0","read-pkg":"^1.0.0","symbol":"^0.2.1"},"devDependencies":{"ava":"*","xo":"*"},"fixture":{"foo":true},"gitHead":"079fab87b04819091fcf0fc27baa9c767f602344","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","_id":"pkg-conf@1.0.0","_shasum":"05b24fb6f4df5c2d04b30bb155f38c8abe23c914","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"05b24fb6f4df5c2d04b30bb155f38c8abe23c914","size":2203,"noattachment":false,"key":"/pkg-conf/-/pkg-conf-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-conf/download/pkg-conf-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1441189679319,"_cnpm_publish_time":1441189679319,"_hasShrinkwrap":false}},"readme":"# pkg-conf\n\n> Get namespaced config from the closest package.json\n\nHaving tool specific config in package.json reduces the amount of metafiles in your repo (there are usually a lot!) and makes the config obvious compared to hidden dotfiles like `.eslintrc`, which can end up causing confusion. [XO](https://github.com/xojs/xo), for example, uses the `xo` namespace in package.json, and [ESLint](http://eslint.org) uses `eslintConfig`. Many more tools supports this, like [AVA](https://avajs.dev), [Babel](https://babeljs.io), [nyc](https://github.com/istanbuljs/nyc), etc.\n\n## Install\n\n```sh\nnpm install pkg-conf\n```\n\n## Usage\n\n```json\n{\n\t\"name\": \"some-package\",\n\t\"version\": \"1.0.0\",\n\t\"unicorn\": {\n\t\t\"rainbow\": true\n\t}\n}\n```\n\n```js\nimport {packageConfig} from 'pkg-conf';\n\nconst config = await packageConfig('unicorn');\n\nconsole.log(config.rainbow);\n//=> true\n```\n\n## API\n\nIt [walks up](https://github.com/sindresorhus/find-up-simple) parent directories until a `package.json` can be found, reads it, and returns the user specified namespace or an empty object if not found.\n\n### packageConfig(namespace, options?)\n\nReturns a `Promise` for the config.\n\n### packageConfigSync(namespace, options?)\n\nReturns the config.\n\n#### namespace\n\nType: `string`\n\nThe package.json namespace you want.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe directory to start looking up for a package.json file.\n\n##### defaults\n\nType: `object`\n\nThe default config.\n\n##### skipOnFalse\n\nType: `boolean`\\\nDefault: `false`\n\nSkip `package.json` files that have the namespaced config explicitly set to `false`.\n\nContinues searching upwards until the next `package.json` file is reached. This can be useful when you need to support the ability for users to have nested `package.json` files, but only read from the root one, like in the case of [`electron-builder`](https://github.com/electron-userland/electron-builder/wiki/Options#AppMetadata) where you have one `package.json` file for the app and one top-level for development.\n\nExample usage for the user:\n\n```json\n{\n\t\"name\": \"some-package\",\n\t\"version\": \"1.0.0\",\n\t\"unicorn\": false\n}\n```\n\n### packageJsonPath(config)\n\nPass in the config returned from any of the above methods.\n\nReturns the file path to the package.json file or `undefined` if not found.\n\n## Related\n\n- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file\n- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file\n- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories\n","_attachments":{},"homepage":"https://github.com/sindresorhus/pkg-conf#readme","bugs":{"url":"https://github.com/sindresorhus/pkg-conf/issues"},"license":"MIT"}