{"_id":"@proload/core","_rev":"20-6c117807214eb132d386805d746b998f","name":"@proload/core","dist-tags":{"latest":"0.3.3","test":"0.2.3-test.0","next":"0.3.2-next.5"},"versions":{"0.1.0":{"name":"@proload/core","version":"0.1.0","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.1.0","dist":{"shasum":"2dfb49798efd54dab50083003eb0e6a0feeb0cfa","integrity":"sha512-J+Ty65Uu+VF5od++4qnil+jp3Ry5X7cIiltIOg8IODwvatysv6UvxiGJzKjRhzTeSRrUvJN/ouZsnZNx+y7rZA==","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.1.0.tgz","fileCount":16,"unpackedSize":16960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI2SQCRA9TVsSAnZWagAALC8QAKTk+8p/uynqtdrgD29n\nAjk1aC8EGIB6Qi12Uy45dFk+m6Ox1fWlJ0YnzfYPsdka2GgHCNkilb0H0MZG\nHneI9XH32Von60LvdAiXaEA/xgmXbASJeL/F8lbCdCILZv2baofmV/iiAwOo\n9c55/fdfwuGGaStxH5fGYeWlv0/1jEtGIigdYRJao5taWbj7FjSo3RasBqPo\nAx/mm/K7IkjgocEEmR4T604q/UbePEWltiud/ryvg00PEUjBw+8jehu9W6g+\nDHt1tmCTWVPPi9BbHWcgfBGwkKKePb4CdlNXAYjMGtH8TCMPG9TsW9rsvAfe\nSw9Wd23XwmvpHutb2GpWEToPA9kSzyAjIQ778qsPtoz7Rl4NZcH8QaYlXiPs\nB9iR/LATlFbYNhO2c9vFQiEJMI/BrhQmwlBKTdlZLVSvZzr/Wv0JgX5KBaEs\nQuC4+bymVT9F4muKL1mnNcFim4Mu/gZWJj21nfUaWVAGIs8RJ/QXv3p4fr7W\n9neO+KvCeLDsTMvK3SOnwRYLhQYWRsawOsqhY/bsb43uNXBt9DZy8o14eFbl\nmwJXiUwDbP3kZyCdRkhm+q8yqcMj9ZTKIziNKCgcRhvnU/SKdLdpLfXO4dh9\nSnVhuFf6Gr0hoa+i7Cq+gja78SC+UmRy6+hbeFW0th/N2FwMygdwnDj8H1GM\n23Wj\r\n=sVI/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHT5h4QCDXB0qaiournYmaZIoMY93YBicm6gR7A7g5N7AiEA3YuwtLGqnMrdZMQBgje6A2jMsHUVERFEYmrq4UhmSew="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.0_1612932240425_0.829102677384504"},"_hasShrinkwrap":false},"0.1.1":{"name":"@proload/core","version":"0.1.1","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.1.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Xc+7IilpVjntRDlRXtyLaBNa/VD7JjEJndQQtCeBKgi22uH9ck4XWSeKdq5P1ynuUYbZv40dhERHtC6hnN2VlQ==","shasum":"1788a9c6a6ff321983f8a89a7820827ba2c2b2b1","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.1.1.tgz","fileCount":12,"unpackedSize":22367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI/hiCRA9TVsSAnZWagAA8hgQAJ9vRG1adbJqmG8aZKH6\npTybw37ZsQ1uCtCNswC4VCCvvE14NhVsd0bHLUlxQEgGhT//8wc2tN9DyFFX\nJVU/sy9KDI9v10zEAhXrcDan5L+nkMta70Qb+qbljfVK3OR3Qze4i9kqp83M\n9phUhd5/sEYhx8sW/HZLttHC+YgVhDsUJ0g68/wyiEWUV0MmkueXY/KyIC7o\njO1pgr0RXuLF+xet5CO0DFAT0aadhgP8Ry72u2sjqXpI4c24eDpIglDvPD1U\nyeyYxuNdiVMjyKKtYBjsKDaHFtF1pF0RQNaLI3Pj7mNvO1jmtuzPiRk4OaVK\nKFYKyQvHWK/asGWvR4gfFSm6kAOKX/pS/6s/Rmg07FaioEKRm4J+bFYTxUTe\nYCp1zynrXqmI1IY8e1cn2I0CenSpwqDBI685S1H7nB5hOV64XnP8EIdojKi9\nw9zl4hYaoD1pT6w9CJFVmuvDvrrulwJ6YyZiw4jrdiMR0o5qIUF83Nn9C7uM\nbq9IQst7Atn7PRSDs8u4d8A9naIgNlns568/bu0ZCCGGy45FgeftFZX0gZk4\n9fDq/GSxc0pu+Wmf7u/+/z5ZPZ4Xvwg/2CpgrBiL9+dO//PsHXsrTvkK+80T\nmrV+CE2V6bb4l8/u7reOilVURaKbgPkVdB5RtuEg6C3G1Kmq7YdclEi9cjTs\nxbB4\r\n=d23F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMf0GkmxU4iWp4z0No90mOxGQUzvQHQuvcOUgchMLYeQIhAIv6T3NljobkppqPDlJiUjxOFQNA7x10aN0hLv1qc7Sf"}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.1_1612970082449_0.003433067042703186"},"_hasShrinkwrap":false},"0.1.2":{"name":"@proload/core","version":"0.1.2","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.1.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-34I262FFjl3fOCSZ8JTxTeXnIZWEwyU/oqkQa9YdFgcnAfpYarW+FUgFdjMseF9hS2HareddXDaZe1cgXrtUGQ==","shasum":"c512f9e73c21a87d3fe9791ec49a5c7064b69f28","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.1.2.tgz","fileCount":10,"unpackedSize":19849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI/jZCRA9TVsSAnZWagAAF8YQAIYcv2bSkFWwlom2DMhI\nNTnEphQ9i0zwLxKHvXmqWdppIEolUGPjyvrFlp9c+0At5RynfbpYI6s4i0HV\nCSfCuPn7IZAx48XgDa1DUWlm5Z22J2qh4o5fQOtud/m/eWDn7y7vxPqc4C50\nm3c7ANKKH9iRpZDz5ov+vGjl2eDg9IsGE88mOmN1hc699f2UGwQMQVKf93Po\n0zBwv9LRArr6RRFfK5d6CohfzOAWhWa3EcgWQntgzb8nr8oYjRad1QmJPN9z\nK3CXTLDjL+JwLuZnYJtz2fQyybaQw2lG1F0D2Jy2HcSSkjhKOyaOm+H+HtUK\nsMw8L6SACiSEoYIKNDoYJAvnHbAoUAMHt/8yloX1uAj2fstwIIC45cPaKNl2\ncP37gacCNg4hhy/rnb4SFgDZUkj/4HzvOLs+BJcCB78XypkBycwsQKjzakFT\nu1z8KstdpQo6TAtNRrmZUPEQAPV29zzr/8yxD5Rw8enxYfHmKxpIlMtqAIE+\nvP6xbAIvywvThcJuYKuPnMZN9PN6IssJZxB5r1sn1XrsPCmw6FBVCO8nsxLg\np2fXpja/YmEnQSH8aVr1GlgaJOCjEKOD7isew5shUgtkDzQ/FyE4ERIhv3+v\ngmGg33KHLrElAFqFEGbve3YLKRhHgUq4R/DqWVK+6QILwWEvTYSl8Nn++rcp\nh5d3\r\n=Jyrw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn7M0Qx8CnJjyip3JPHuqZkOJ7ACrX0m5BAmO/7Kb/HAIhANr3hcrHVozojPqgQFPXC8cKFD7v2Bs1U/xAH8fy+awZ"}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.2_1612970200789_0.8199429367286093"},"_hasShrinkwrap":false},"0.1.3":{"name":"@proload/core","version":"0.1.3","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.1.3","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/fnUHO0uD8PKw6+jN+ulcwuiidVEzgxEQ68LYGckezrTRVR5OtQvprmEsjHfnhtjxqSfmRAiAr7j8bd5jsSzlw==","shasum":"abd35b47ddaae771698738f7698e5eb0ae066ebf","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.1.3.tgz","fileCount":10,"unpackedSize":21964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJK6kCRA9TVsSAnZWagAAUfsP+gJysgbzfZ9EgKo12LfA\npRGfe5Y27iuo3fHO8N1W3YimHAaRjJXuPgjjdVtWWUIDrGmRcGb4Pj95MpX+\nhiTAPjx3rPiXPI94RYmZvx1c0ZTRgc2oOKJUQ6JcNKv/gtW/d8MlEdSME0U5\nVVPorzbYrRf9lNs0dhn7V2I8EToVR9LKR8ygLuS4uX+e/n7T9GEGglBZlJWG\nvZQ9x5HjpmiknLcMQQle+Hsfq27fYdjiRCdpmDbcXdfswGjTKj5UM60FnOEU\nYbS2hrB6Jp94sQKmUu0ualX4S92cINeNIh1f0OFz/qX66WSVdq2cHPppAtRJ\nX981MvIAg5jUJuJDFjYwlqnIZJ166AnShtWl7lVCZmmSF2nud9vnWw/Fh1hc\nawKH5JuETaEnMjk+b4OAVm/GnPcZJCIyg0rymyQZHI0MT1KVCI6yZY/vDjDU\nG1ehkMJq0MJjgPP9IATbPPdtUEqZmcL9a/0Kg3gmMLKA7yE2YjxsERuTzILG\n6uLqp3gN2oFTfV0D/57M2qRnleiIsMEBXeDUanxKKXKOKG7B05/IqgSfb6NX\nfkTLyE7UYt5oHHhI1mtPdL6ur7w96BKzMIDMmNvdInKErErp3cCaPg+XVq2N\nhgpB/P+zto9XxK2/NP7nWwneU8M1SzEx6txXCVHT4F5/0RmpzrXw+pH7s1Ot\nXtOQ\r\n=zYlq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6QFVQbObngDtq5eu+zKU0sYzVaRwGzJwlXkyKsgD8iwIhANxCnheaKhTp1wXZWy+PN8NGF3LfGLtefpJanKdfpRAX"}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.3_1613016740363_0.8712519198481175"},"_hasShrinkwrap":false},"0.1.4":{"name":"@proload/core","version":"0.1.4","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.1.4","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-lLFeBnfOdOjY9H7oN9cEzMiQKGQ45fP5A1NGv5xqrppE0gYSLK1rrfoqThVQgcS2Q3fnTI/z/G47noquKOY+kA==","shasum":"4ee7f5aea08a4fc6366778fbc104bdbae6a060e5","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.1.4.tgz","fileCount":10,"unpackedSize":22093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLy9aCRA9TVsSAnZWagAAlgcP/iCgCc6MlgVHygXem1Ce\nmml89qk+P5K2OQPhqeLpr0YCeV0gssb0joYBtZzQ0An5vzN2sWL1/JVPPUGd\n5sAHttb5pZEgxeSXF21IJvXUpRFg7uZy4wW06leaEynsvrpssCzMYM3sZmvt\nH0xftBBueiRkXVH2RJKv/2VfD1yTZxJwQ3EDajvNUIu6SJjcycOft5Z2BIZi\nUXtWUI+vvMjA4VTRSxfWk4jEbC0JtvlVTcm5ODcKmSDaCI6ZkSC0DjGwTsuo\nebvcCG/osk5MDHauv0q4OygrtFAquRrQ8htDd6MXItHgjtz5NcS4ZcAISLE+\nR9i3MsyrYOrfw5E4d1/XuIe0V6fEfSV8/zev3f5RvmY3xShEW6zYa4Y9hVke\nlT1dZIyBerNd2MHkjkvMzdRK6dVqoTREPJVyFVMTCN7Ie2eEEc0g+0bxILs2\nBb58r4IhOjYY0DaCPPjHU2tmKabjped+1uoZnQYaQ4g2syVYk6eTG0eXGbZX\nR+MG7XP4+IWIpVJU4RvhSpjRXP7ze+4nU47aA5JWKehGCeXaL7blUe6eU1/l\nYPBnlO5Knxx43j4ooNWDAzfrFKTEn4cX+HRC3lZ/2UhWc1RqmVym6fEjqSdG\nICWOYgitWRd1dVZYHSNcscmrTWrcz7OO4NZu9hNR6seh7ZtPPRA1L4GOV62H\nuF6y\r\n=8yFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZqin25kBYRivrQhhEgcUIrjmImYRGHGAYaYXFBKX/KAiBSCkfR/NLbkJ/W//RnPVHXhDfsFEPzU4L0hnYRWsolPg=="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.4_1613705050031_0.2912903842841341"},"_hasShrinkwrap":false},"0.2.0":{"name":"@proload/core","version":"0.2.0","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.2.0","_nodeVersion":"14.17.3","_npmVersion":"7.5.2","dist":{"integrity":"sha512-R9yatvCXMPM9LDlTfqVCeXeIl9ZFZ8mJYXuhZaqzPP4v38Tuldcj60WtZObLzKJbRCGA6Uf+YEQ265m2EnTgZg==","shasum":"8209619cea579b6cabd0cbdfb14b56d8ea3957b1","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.2.0.tgz","fileCount":10,"unpackedSize":23848,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2MSWPt1nLdgTRqCE9BauSZ9uo0x9fTYQnSf1RTWSGcAiEA+T849lVOAzDGWMBZYmt8zQxEOYLcHBCpjV/2nPIOZqY="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.0_1636332575953_0.333660712111558"},"_hasShrinkwrap":false},"0.2.1":{"name":"@proload/core","version":"0.2.1","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.2.1","_nodeVersion":"14.17.3","_npmVersion":"7.5.2","dist":{"integrity":"sha512-4V7hNxF3cswyDxUrHubiHjXkMC2O8qN1/ruPvm7vg9DtYMSaVaISe7TC3NPA+5rVO1cn/CmkbDc9yU/n7w2ZmA==","shasum":"d1218e8aac6b85bde87a0578668b5fbf37d215a3","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.2.1.tgz","fileCount":10,"unpackedSize":25085,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGFoKizDwvei2VtivFRERVyG2OTdYtau4PdbwJqfvy6AiB0ELlEaR9VfKwgTPKn+wkPF9M6MPz9jgwUecuXXsEWqA=="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.1_1636388042980_0.7588617548026066"},"_hasShrinkwrap":false},"0.2.2":{"name":"@proload/core","version":"0.2.2","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.2.2","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HYQEblYXIpW77kvGyW4penEl9D9e9MouPhTqVaDz9+QVFliYjsq18inTfnfTa81s3oraPVtTk60tqCWOf2fKGQ==","shasum":"d6de30e06a8864bdd0fbe568f87d0582cf988c1d","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.2.2.tgz","fileCount":10,"unpackedSize":25156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2XWNCRA9TVsSAnZWagAANPEP/R6jCEVDWTQPISmGeEzq\nVYx2Fl4a4KNpZIdPAD2Y1SxH0Dh+7JappO5uiKT7pz/rfZ9mCEGZ4ljSWA0R\nquf01TOcM9uGzUs6jG8lHhR44d0Q3RPcEA5N0r0y+yk8+lx8huRP1f5XrhvV\nvUxeitP8BKLfQVkQXQNNhItPLoEumaZiTvNowc1yY3RNRWDHVtbTjhzO2u7R\nGYp0bdlxZc7v9gqDPta88zilc7g1hR9O8anYZNOe4Tw999wPyKnQcTbyHkqe\npfZgz5q93MGKSCYZ2VANfEbdvXyzpiznbvmZNNCGaeM9mcUiP/0xVFI7yN2j\nI9l9TPsdba49jjUQSHhOhoOnodsoLkyd13jsKHJnaSiENolSRJhBYuKfLsQA\nQCxXNSJzn2FVdj6RjKhu0+mywc1cgt3jkX8ed0VHlLYiFpAC2I6zafCkmMhG\n8nc5eNiub7jnprRFjctob5ZePunhNJjEe/giVmj+sn1Ld851G1tGrJ9LpogE\nKBS+eGP1y2zNOajded1/oxAQq5P3lNK+6e5EWRa4sOLamkJqoGkx1eJCkilv\np0aBV8ZBzcs/y7TlFu2kka2cLzQCXE3+xqdY0S/wBhPhXmmTASHy34aKPFSw\nE+S0ZdN42RccXmEAupSwpid0pYT3k+vPbw4dAkvG+yBUXiaGQxAh4b8qBGtk\nl3y7\r\n=FfOX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3/GNv2I/jwJhXrjlTjIAtAhph1JkF8WkXrsphxzhKFAiAj4LwO5MTfq/UsMbIh5c0f3SwQ8dkpdQGXXhQOIRvm+w=="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.2_1636471493960_0.9503156988936656"},"_hasShrinkwrap":false},"0.2.3-test.0":{"name":"@proload/core","version":"0.2.3-test.0","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.2.3-test.0","_nodeVersion":"14.17.3","_npmVersion":"7.5.2","dist":{"integrity":"sha512-CGMOX8Fyd+oQNA7PX7Dyghr8ZmwgXi0avKicB12oTW6RJjiVtD+42PKeJuXU8MOuGkxv5JeZfeZJL2+8ZHDFWA==","shasum":"73995b96ea136ea78a527b157ce379f0399de825","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.2.3-test.0.tgz","fileCount":10,"unpackedSize":25200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/b6fCRA9TVsSAnZWagAAwXkP/RPWw4DCAjO0n7NA3OBr\nvlVm4PH3CllMRdRLt9U29WR79pxroNoJ7S5a2trDH65nI7CrjPrUsFEk0NJZ\nX+GlySBkTfkUcRLjqI1vmqJVdsKvsksP+17OtDRPYZpsGGK6OpdTuBceO9jy\n8WY1QbSIw4+YyZsbFC2T5vrFfUZT0Kt6kOyTD0+Vm8DQXf7zkMQ4rCBkBcJ9\n4tjz5BhGnj35KSapVGSYIMU0k+vRMD6pmrGO6pxbXpcP3pI/4aHNPJhPp4Xm\nVPtq1zfG73J6+bRZVPyHbcbJnEmvmz4lO++eVoCS4UYqIzK09TzPzQDQxXKd\nCty+aXHCAmiHcrIM205hvEqw6AaG71OdY/w9KaKkgPNjtEMHmFbsNZBhhr3R\noQVr+bGrVueXP4HUBeDX7PxNBEuqj8TjivD94tMC7zqKQYhphqZb22JRkOqE\nnOTd5q4JdNFbqPA+sC6LKKrAmqw6HkpC80lpbh6ZXtwdsNwjt+8vjHVH3D7e\nKt1C53Gmdw4s+attRPQff4B1QZy1dEoggnJ1cyG5D5SVh6u4TJj/sUuQU9QL\nlDIxoHcdGdysuBt/G7NqtP7cg2DZTIAPIbFxLA37+pRvCUvI7X2yvn/O1RfO\nhd39ocDxod+GjEcS6uyhfaaKboAhmRs+uj3ZukWoA+yiRXwu0Pl9i5biBYx0\nBHwi\r\n=Burg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuHpSlITMGvRQZDFDC+NT4qL5hbbwAOuGVgxtT5g52HgIhAIikv4Kupd7o7/4+f93/i5sGmolKd/arqPz2K6VLRNVg"}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.3-test.0_1644019359355_0.2307384696076824"},"_hasShrinkwrap":false},"0.3.0":{"name":"@proload/core","version":"0.3.0","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1","resolve-pkg":"^2.0.0"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.3.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-ui/KhXGaNvK2fEuvYw3ZJS7hr2Jb1MmgIG+cMrbsIjeVtjtdq/cIjPqU4wZMkhMgQ0sAmvbIjB4wOIJEzzxyXA==","shasum":"dea951859746012fd25df1125150f6686f8d9911","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.0.tgz","fileCount":10,"unpackedSize":29896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNnmiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUnA/+IhY1RLaqHLT31fvxoYpBmF1dRDCK727yNOebGAqVOUJ/rHcR\r\nVySJxQJ99YHDU5vyzGUSvOngewrfEKbC5HToNMVZNFMXHHybXFcuzAJgKddI\r\ntsBhEDhnyx8lFYfaSq1S6gEQngCnoHYzDmnB6Yyal50HvXEibV2u3aY68p9K\r\n3LPlTihyPQTkmdpn91kmZoNeJlCAQ5PaD+8RvdG1Cu2K/PNJIuxLNLbGQONC\r\n5eRghHc0Da04gBFi6Jq41oEvwtBpqkNU+i3CGDVxRh8go+ovGFDZYwlVFL09\r\ng1xhsgF5HENc5/i0vrZbt8lJ1h5R2pARlkXdo6GmocJkZwm8baWAS5IX0v5T\r\nOb/zxXaL4ZVOCPaCld4DW4BwyoCSuClNC/yJ4oo5Shq8CT/o/28LkHFv7fzc\r\n53yGz9HJJNAWF2Zk9Xb//rxkzauUecLD7+saE0LlbbXjt6IkiE4p3oPaBD3H\r\nwVXm8Y3PulsIHBX1PJ8FX95A/5AUN9wT78nvm5DGFvARLqNqfCY1e7z/pQdj\r\nlos1oMQorrWeQa30x8htCI/bw4nX2Kw0h52CZnZViobilASFeB2IlsQax6UD\r\nk/nnJuKSoCIAae6LTqhNRO4Y9tmSVkyw9bch8BldCIHW9B/7R+RL9/8S9WHH\r\nvlpLHWr0qtcvOKuzmKTr4E2jUZh3wTm1CdQ=\r\n=mkQ5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDwhCDVCxceQSGFxBzHd1Q4FFIuPLCQ+7o5AQWXl4miAiEAxfdf3rnPT11VD5D1k2q2Wn0N/cm190eFnggNnXqMTdo="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.0_1647737250076_0.976151145315477"},"_hasShrinkwrap":false},"0.3.1":{"name":"@proload/core","version":"0.3.1","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./plugin-typescript":{"import":"./plugin-typescript/index.mjs","require":"./plugin-typescript/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1","resolve-pkg":"^2.0.0"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.3.1","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-u902sdjipQ6WjpV6rxcF0CnQP6Z6Gd54MBPuMbZ5amCcdb/meWY6UtCQSLIJmG+zbXtf8Hwzf6ePBey158QAQQ==","shasum":"7d43a2d212c7aa2c95d116667df6d3de25287174","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.1.tgz","fileCount":10,"unpackedSize":29948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO+ZUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr95Q//fpv8vYkSKSSLPQYDEGmjj7zyC5A+Yn2JmB+DPrU48AsgwY+B\r\ng2L91TGOzgKh7RNfHmOv4lv/eMonPabJAqBJ7bEkeJLX8i+aeGIqfiB2Ab9o\r\nXVxaKK3s0eg1F/ia/4ablCeUex3nNUejJxfwGLdsoPdrRjc56rGJCckxWMWT\r\ngRhxkd16oJXfmj/tqFYcE2oGJiQ5AAhPTZkl1yJaIrTxg19kQ8BhnPIDghgo\r\nAlvxaFYked63xbsZG1pfwz8T4zaKUmXp0rLppI1R6pyyapp45sN7x/guxlTe\r\nj6CIRvJ7c+Xsvp+Zz+JbO/HdUZ+7GpZjPuq9YJVMzif+eRuf/4VUdOq/jn/s\r\nQmbV10dzTE6Pk0fbkRLA6Z6lhnK4vmCGEGJlNmqqNYYN6XLMFTLZQvb67pHJ\r\n8NYkElmGLoaMeqvzzsH5SqouoPIBDg3C1CkD7zwQI4f2l+gkMEMkWXkb68mt\r\nhczRcOWXPeVk3laAK10rt8Wa1ZcKmJ4D0vwo9uuhNIZFXDZIj+Z6IYJ+AfYG\r\naX162fHohnb5uGQ+DEws8ZG2IGrhSK00V90Vl7N3jeuQqLfTVzmIV4a50cUJ\r\nCZEKkz8w/rgnx0Fybu9ytle9bejC+W29VammZnYIorzmTdBMwzgesJz4ljLi\r\nPpGp84yut17IMwHuNssLAsirtvGEukYfObU=\r\n=yKsN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFgvsyIFymcXs1lIYUT4//m4Gq7TvPF5eVv+fb/18fW3AiAVSv9uKAhhsiicm3VDMTazahwpHqpqIVab5rRdF1kg5A=="}]},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.1_1648092756029_0.13504434521322062"},"_hasShrinkwrap":false},"0.3.2-next.0":{"name":"@proload/core","version":"0.3.2-next.0","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.0","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Q9e4ALpKs7wxYsqpxP0LpwCmZ+Garxj0X8EV0TNSYzYsdc41+gXk5zWwVro7cPjn2lHgNCQnaIKBEpqvU/qqEw==","shasum":"9ec05a531f0f84450a624d6c1dd5ae35c65fff6b","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.0.tgz","fileCount":10,"unpackedSize":30076,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH7bq6dDDn9NjmniUBnpdxlFcrtJDJ4x5pgje8Y3pc0AIhAKsMZl3cnCI70W6kGkrWhBIfKFSNzjtXVlR+WmItnUEm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaAWPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYIQ/7B5l4UzDPxVqHOpO+OR8v8kXG6XDD975DRPYiJwg4kn0vKOdA\r\nDjGYTmPNWzGn9V7tZM4ldr3dFXlelDmAviylATZnMwycsC4wNpUI/bfj4jQs\r\n25JnEwkVm+Rt8QfUQOvrQRI0LnuF4douHHrf+KddjmRV/TxcD6sisZ9b83vx\r\nzGhaHBukhai5xDC+J64lS6BdkaqtPDMQArONZMMQd5EmOqmaK1t4PmVl22cE\r\nQFvWN8Xq2OLt4/Q+0bv9RCpNTmf0VgHwxnK+4ABrwHXFBrJqaHFw9YrC0HYF\r\ny5FYpS9l4kXS79URkj3TVWSNLmOYDlnXLhL6sn7kgi0ZdXuaoKScFUbNqlYw\r\nRj6TLwjfoz8XoiAicANG5tEM9qal36KdknLd7xJYOfhSAHjO6ABOJZDK/bR7\r\nybU5c+7VaOELQkLvXCmcKTD8DfMXRwGWI3h0LmxNmK19lh2a9fThAUIHgKfs\r\n6g45lIQ6DPOtfya5k86HHe0AgWD8SUBw5yjPoAzkJ/uYGSDa5f+ku5Qoze/e\r\n+0xqJUDcVvWVztTlWi8CiUT7swHBQ8Nq1ZdI82XT2DHnkkIDg9tF9JJbzQnI\r\nG/qR7yr4qbmTqAdfkfHnjdTjWdCuAFGx6duW/iuAaPmny2Gz9LrGHGl9UpOB\r\nd8oX9fva/Oj1cUJCA/KSXHRMjqtobK3zSLY=\r\n=drsC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.0_1650984335763_0.004653827077850448"},"_hasShrinkwrap":false},"0.3.2-next.1":{"name":"@proload/core","version":"0.3.2-next.1","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1","resolve-pkg":"^2.0.0"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.1","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-qPcArX0cfrtiKdX//2ab02FIGlQlj39PMdp2icJDEdf9pNkecasANYZVwMrfdLu1o/+8aEba7dBVpQ1er08dZg==","shasum":"4ab33e557429c4894c8abe1dc166eddf311f2df6","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.1.tgz","fileCount":10,"unpackedSize":28749,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjfth8AzoJGtp4hkdqXbxDsJAw6gIQ6t0ac9jy47QuIAiAR9G/prNpMqAU5tnoGBkG/OlmM1A7YoDuOnl6TLogIjw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaA7FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8rQ//a8Ni8iKoGM1H1nmcPlJeA3fM6U0U6EgAlF733J5d8fbSGEhX\r\nClB6ZlQs3b0lpclK18XMGr9mSEhhZpA8mB5sQda1iUwgW7t6KliLZmwZL+rR\r\nAExV5LYqFrZZ82DW2ZEBm62pyJ1EG6Op4ytM/3FJkborlwYDkro8r/95bb72\r\nIL33tOQtgJpPfXo6Qm3CcwGUmT5soF9/Uk+4GZRV+G30wL9kqmC9RkBU4igz\r\nv31xb1MOTbNLoB++P68AB6yO5s9vA4IfzZ9Pp5Vt7PseWV/otEJD2iempxOr\r\n4Ta2Db2Oj3raScsqu5YXdN8NWAYiwHOLz+LBPFSmcwjQLULf6MjK8vN8NYUX\r\nEOyNBur5zHPEtmrMSnnY1klxCYmmTNG33lkJDb2EtiCKtO/SLa2CWBPz5ko4\r\nh4wFEEGOgxDPCXQ6JTEvFbza/2udKbPthE6HhhfJGHDhS9ymifyYZXnBMzPe\r\npn/82V8Z54YjNEKmq6f9TrfDThqpWS/C3+9lhuXrhRpqZsjjD/QyM6TuT46O\r\npLMBstXR/apaYHbI0Z0OP+q8lh8sT+w8xw32WWNcGm9KvSVKVeyEowYA5rIl\r\nKU455hMiBUCWOBOHcypw0NJ0sIpAz3CpIedqMS9zLMUTd1oUrR0qDv1Or0Uv\r\nJeuev+3thKWgJWp1Wi0wvXMgQIjZJ/6afkk=\r\n=CqaT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.1_1650986693217_0.4524984735903923"},"_hasShrinkwrap":false},"0.3.2-next.2":{"name":"@proload/core","version":"0.3.2-next.2","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.2","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-r8glvSE2EYXGlbEqu5BcS/xCLXnX/zQ07k0xJagwydKCzCXcRKuH3RG8EEYPM7H8VUlF5N7Lh+uFPTzG10iF5g==","shasum":"93e5e4565ce33870d8db994b6b0774f7e8f16862","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.2.tgz","fileCount":10,"unpackedSize":28860,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGobg4gzNZ7zoJVS/gn6UjpDi4p8KWErK928hPcFYuBrAiACsTldHpqXUJz1HPKY9PUzOMNmX8e7jpIXoRL+ztwU+A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaBPLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsRg/9HfAkGDlPkE1vx0TT/F6l0bzYHHqhMkYVem1POcjJXtDACjOm\r\nfvTmH5Oy0Oxo+C1E0THLpAzOGP/+V4P53ZKCvj1oDXKXdNQCIT3SSzfx7wzd\r\nwCxzEY8pfXNSptHCJtrjsV7ZMSEXmR6MOxva04p3J0knzlHd0J6Aqo4g9FlC\r\nPqGmm2z3x7Y3h/9jMLDd2Fm4WOaQ1DAY3TFb4b7QwB7Vp2c9H4sXTq+3a+vf\r\nu/APbyxCD1OAr5kSp2AL3I2T3awSqhxeuSv66kV0HlXYRTiF4tgPtKJIuOgm\r\nI+DUmDM1ZdoVdu6HpYB/WZKVtY4iTxZECjm2WnQpr8sVjpamoFr635pDgFhq\r\nFRV9O+PqNUHrXziwMw4upf4YOLp3/nHYGaf8M78gideGpVKIVBZ+nB/WrBhI\r\n+xxv1vXC+jLxwoCVfYVEIOVTaNcKWHTAbMchzbEjokism4EoVX4JKCrWEGlf\r\naheZ927cXMq9swkzNg+4MVFmBStdRKB5av8apY/n/X/swFBo0SwUPecupP84\r\nVlmi+x/vlleWjD1MKfhF3QzYo0NLcn7wCxYsqnsh+O0oMUByagKDpDvT9btf\r\nsSf/zO+bNBmLF+C8j1Bvg4t60kuE5BXQgk8ItfYLScemaIS6NWPe5MfUCEpX\r\n2fDajwKhE1827RpzpTO2DuaPmssXP8gsEW4=\r\n=q8MB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.2_1650987979237_0.4314800385645057"},"_hasShrinkwrap":false},"0.3.2-next.3":{"name":"@proload/core","version":"0.3.2-next.3","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.3","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-TU+3s0rJE66wErD9Zat+Cr/5vdR47UvWf14CMPScFnruW9WllGh/vLTOEJH7l0IbSP+lsZnmWUcQ3aS2oZNYyA==","shasum":"17ac4e7e0287f4fa6588a41a149064a90adbc5ff","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.3.tgz","fileCount":10,"unpackedSize":28913,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5jKL42jC7bkp79Hc32rHGTttMSUzIlXbummkZzyg52AiAGYUsb1+3FKjdKo6j4e24fv56luJe8OShkUhKc0dKxsA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaBl4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyzBAAnsprklduThP1G7gLQ9Q8dIoNzy9xJDbsDCbYJ9TH2RTDWWY1\r\nxGbwgNO5E9m+cq4hUVg/QvkDdzaFKSVWZKbknnCJRkCnM4I7GsjjMmEbHe+K\r\nX2oLUlffV2w3nNFb+9e1mgVH6dtlrNO0C9Sprk1OYwjiPo5aQpXnKV353fpI\r\n7yUUxe6Co/XbEQ0+MYPSuOGXRIHyL0Twsq28PVC3hKrhVquuwzjcE7FaBzx5\r\nZ6BFSa4kOXWJVfePu/hjYx+RFJEamh/RH0yMjuX9qUcuMr45UPKmCu0Ylwkb\r\nPbsFNRnPGuglmifaPCNztCeXkOtgXbniSkV8Oqel7nVlHDkcFi/ao5O7gcki\r\nSv8NKzsaTQcs0o9zyJavpP99emAzZE9LD5geKlo25DaJbwN3p2U6uFMqqFQV\r\nIHZihDluDadQE3pGlpGfJzhOJWx/SeEdthUGBgB/DVQ28ipF4LVmGwx3Lx5a\r\nK6VLY+iiMg655ZYnmVDiX9s4/YIQhOnxHuUnsU6tYc+5xjEbaxun+l7TMhVe\r\np1/nia45bBP6ycsaPToKluz0LlwXbNKYm4mmEsWtGJSnPxJPHS8zhxhsBMY6\r\nhrRvAUi2cb72rqNU8Sfk67IvVHqcWWRR7yr3zvToz6qmX57FyVA5xOvEkXLu\r\noKE+MgUfha2extLIsMto0QnwocRt3ysEHNw=\r\n=jySm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.3_1650989432526_0.8792481047535845"},"_hasShrinkwrap":false},"0.3.2-next.4":{"name":"@proload/core","version":"0.3.2-next.4","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.4","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-58nw3h4+qBDizhlTbt/Q4iGWiiSWcYqdRgIAy3KMla1nqNFO8stG5vzDjPGMPyX6DsAhEj3PCqb4G0d82b2kqQ==","shasum":"f111d03685e5ffde8090dccb36225b4c8c163e6f","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.4.tgz","fileCount":10,"unpackedSize":28529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKi2IEAmHQJ2YsvZYdfA1OEZlLk9T1aayOFWXy0c/gIAiEAnrm6Ellcbabwj+O3c7CKxgm61+QCgPysesnPS6vI9ps="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaCKeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGAA//XCPu1zi9BkLphnBiFZFmXv8TwFsHRZyFBVi97TA51Jrlhkbw\r\neDUPfssn3YK3ZYLMLPJFfdmNlU0Y1YeKPcvqzEodNeg/C4+Npjg1WO/+84vy\r\nMAWebWi7j/5oBI9HO9lo53kYIteF/FSjiPkYb9JzA4ucYPCH1WHkOYAzpN1A\r\nTOgMAU6bGou0Dg3oxKulEADuHfGg/Iq/LDkQ5nMDkPrSMGNu1lyOWNYzdde4\r\nbH/1VzW4cS5qlIrLjYNjybS/R8th5aDFS3hmtf4KcffAjXf8hBTsm5Cy+Kvy\r\nnhOq21I7i4kdA2+MlPjlMBuGOfgKLMsUeAaBs6rSuRkzYryzYkHx0b04kD4S\r\nTUu+uusFxmwZdmzpXWU119XOwy7e4PkHRIfgtPu+nyLpos7xjWgGj38VL2H4\r\n8Evy/ICQ2Cu5+4R+gDlxofF6YjfPc7CpeMjbppjJQgJ4ZvnC5hT/UUDHVgpG\r\nYyVuexXxtyw7JZU5AuPKRYQm84sMMvMk3OeB06+34ycgl3TLtgx/JbFqcB6c\r\ntCTJ4hsZp1GSlNiOIfABnoHUhieyEIP6U3gPhsqvMtWwmNfgcl7K/a1Y2xX7\r\n+sE64QtAd07fAQQFEakyVB4kd0vUX8B/kC7CiTreiGuJnTOR7Rtgc4A/0NwL\r\nn6L6kDBFECfycyMDPHE+OArdkB4DoYAj/V4=\r\n=Q3iu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.4_1650991774292_0.9148174629695969"},"_hasShrinkwrap":false},"0.3.2-next.5":{"name":"@proload/core","version":"0.3.2-next.5","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md","_id":"@proload/core@0.3.2-next.5","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-2lhqzXt9KSs/Me199G1sanrI+9PAaM53+vMDDHjgkTLxvz0YFqdnuWoQdktXdXCg7OSYH675WKgcp/u34M9B7w==","shasum":"0a9b906400e8330e19154321a76f31c9be6e01fd","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2-next.5.tgz","fileCount":10,"unpackedSize":28986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGASYEgl7IINik3elanmvBkyjp5bGeCiQ4UpNQUcLc/iAiEAvHjzemaIChtuV1EPJdI+asBcXBgvortvZUmSJJdMEqs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaE2yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTyw/8DLv6im201DfZf2XCMSBAwacSKtM4CTAucSPl2BK7Nv8LsZT7\r\nGVHqgCDxT6XmIa3Ao75gjVUZVStvv4/d5Vc4CfkGThR26+NxdwRe0sj4/hPR\r\n8cZs1lhdQhkX2UwOt5T4Zl6Wq0IlZbGe1SdVxuDRdtdsG66yx77KrbENSwFO\r\nMHUiZ2VLWttCJKKVuz0mNzLef1LfOq9LmmPzG2sTa88HkTsp0FH/tyPTNofm\r\nZAjJAUJuXMJvazIHfjaeJZs73XdO+Fnp87RXyR0o37XJr3sXHJRqeofpV6qM\r\nPNwIHicclIoJOc3D/MA1Ta25GpI89mLuJ39BiM569UeVfDff+OF+/sVF1U73\r\nkQW8PmTyYG9SXM+WTj0Q/rtn/JqcTcICoTyJdo9iFnLK4JaG0rKsenWxSVJQ\r\neGRSof4KcezKMjqqO+PMgbwsJ7xorZKGn3bsBaI13mBnHOgow3ITChUIpC0+\r\nooD3jS1mSEhk8oXslB8TL32gLZ+e/eCq2UArz3HC/Rt+9U+aF2NdcSQeCjKH\r\nj//PCFqKuNmZw+0LDn4FtAvsZSL1silLKqkajKXD0CiKkOW2WGJAHW3GauL5\r\n5JFudl2JUW1slz6LstMfYE38KqguZPB0IO+d0brnhCnN/rbBCyAIv1txgt/P\r\nDmpuHDxj7t1UKjFhbM8OrJCEp1gwIRWKBVc=\r\n=rU6H\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2-next.5_1651002802243_0.8445966313266544"},"_hasShrinkwrap":false},"0.3.2":{"name":"@proload/core","version":"0.3.2","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.3.2","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-4ga4HpS0ieVYWVMS+F62W++6SNACBu0lkw8snw3tEdH6AeqZu8i8262n3I81jWAWXVcg3sMfhb+kBexrfGrTUQ==","shasum":"de36f335bf87dd6aa8ba25aa92c498821db3a229","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.2.tgz","fileCount":10,"unpackedSize":28594,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzOd+kcraijYqjYOTF9F74VZ4zLzAE9Rbnx8dJf5OpAAiEAjFt3rRI0H8asRGcXhc1/cCGJuMonqs4xNwJBQ5KALbk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaFTUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfjQ//QdFdPW7ImcMdzOD+C2ssrnykAVzhkuDKcWy8NQFNeGn3wcot\r\nEfWD+oXlGtnBXL8ntdKy4NOJPxBKNfciCXFABQarwsX3Z1Uvi10S8a9WlVQQ\r\nza1X1/ltpD+0vYXIUKC9iEQ8mF0aAIwFaAvs/84/qRBO9EeepEJN5zV/kwT9\r\nk7LJdYpWcqOxm053n73mVwXX1hsa8TLzAf2i3MtZVsjW/xH570e0yX9w4g/Z\r\nq7Z61Yvp/e/ilYJ6S41mOKXr93BfE+XuFnPzu/rCYjmvbFC5uAp+Cd1ImvTw\r\nMF/6QrNru8Hfldaj2Fh0yDnm3YQRsse14NZ7ull9smdDJEWwfA/emWogBcyZ\r\n3DBuPWknzi81TFmIqSTVYpSnvl6iICfDHA+XBUni3ZlHY1C8oS4aEIek+yMk\r\nlMiaHn+TmgbPTOb1+l/FfWMKMdFdtuyjOkljL+hvv9BUcIhgfZ8WEl2WqHlf\r\nkrPfgcegWKqdgy5Oc1qMP7GZbyXMiNZ0xQoaW//yVvM41CeLBJu7cb7uZUO1\r\nJWFc3k7lj9GwEcwallOQtEYMlQY33SnkVnsnz2qVVzSqsL+wF31yElzP070f\r\nzSp5rJkAJf1LS+bjTtaEvE7qDdfFpF1YZs6Pn/ZNk+KgQSp/HvwdtlI5JNmO\r\n3EmFhD1C+pafE8M6MZh4pZBkysEWz0DKwzY=\r\n=eYPz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.2_1651004628612_0.10639694443750947"},"_hasShrinkwrap":false},"0.3.3":{"name":"@proload/core","version":"0.3.3","description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","main":"./lib/cjs/index.cjs","module":"./lib/esm/index.mjs","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.cjs"},"./esm":"./lib/esm/index.mjs","./cjs":"./lib/cjs/index.cjs","./lib/index.d.ts":"./lib/index.d.ts","./package.json":"./package.json"},"license":"MIT","keywords":["load","configuration","config","esm","cjs","typescript"],"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"dependencies":{"deepmerge":"^4.2.2","escalade":"^3.1.1"},"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"homepage":"https://github.com/natemoo-re/proload#readme","bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"_id":"@proload/core@0.3.3","_nodeVersion":"14.20.0","_npmVersion":"6.14.17","dist":{"integrity":"sha512-7dAFWsIK84C90AMl24+N/ProHKm4iw0akcnoKjRvbfHifJZBLhaDsDus1QJmhG12lXj4e/uB/8mB/0aduCW+NQ==","shasum":"0a30c5ab69e21254b339813c674a6197a42337c3","tarball":"https://registry.npmjs.org/@proload/core/-/core-0.3.3.tgz","fileCount":10,"unpackedSize":28810,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpGCdY3b0fOVpgN7B9qI8rY5Bu1lSYpJXeJoue7ZwAqQIhAPi6mbraYppDcCqZUVLb8qS2NoKmzZrOrBy4ktIyJWvH"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEUN7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMbg//XcT/aEdp663zj3tkAbAdChtUkGvRf0LaDkjwaTxb8ACA04CN\r\n1Vgy2+GaTwckt3wbe38CiorVPjWBpvCCi8QsFoZ6s/pfgFSYEU2h6QAErMY2\r\n/UQEqT9NSjH7lmbvhG37hRHN+D132k07Gqr3eA3T8vIksj51vLGBc3b4Gl30\r\nInKH37Ybw/JuMJZg7Z2GuOSbkw3LnZTEEKlpZ8snlbTkY0pvg5jc1fhmd0yb\r\nQL7uiGavbockeKH4jJ2i9z1IL7Bs4sl+HdjgKUWsZPorQ/pmDsAWRvNXa1zF\r\nnOv9s//njeYXal/ozIWABEfYubWcme+Jwvn8KDIKtzBgksh6fxn3BVonz+sG\r\nd26bCek4sQV0reKCoPKMU0bvFITXmzOSVS6QVyVayJLjVOy6sGSrvbp2NFr0\r\nHrAMHYGhKy6HoIZMP4D2WfLR4/XD2RZOn9u5PCrhLeRNptS5DWqglyh6cy+v\r\njopcubpk5gsonannXUVlql08OvT/xWl/QFXSv+6gkz7wJwSuIJAHU6C+biOt\r\ncj2AVTGMIrStausaQoIdVhQVGuOVqhhFabMJQ8gqR0ubxGvJkuE1hOYoiceV\r\n48rqyZDFTkF7HbTOQ47ztmaQLEXK18HXYTgPoAaxQjrrNDxM+xOgHrrklRsg\r\nhy1peUHGYvjqtV+MBNfN9eFQMf5rO0DLS6E=\r\n=Uv+2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.3.3_1662075771186_0.38458757031001434"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-10T04:44:00.185Z","0.1.0":"2021-02-10T04:44:00.557Z","modified":"2022-09-01T23:42:51.434Z","0.1.1":"2021-02-10T15:14:42.548Z","0.1.2":"2021-02-10T15:16:40.948Z","0.1.3":"2021-02-11T04:12:20.533Z","0.1.4":"2021-02-19T03:24:10.187Z","0.2.0":"2021-11-08T00:49:36.101Z","0.2.1":"2021-11-08T16:14:03.133Z","0.2.2":"2021-11-09T15:24:54.110Z","0.2.3-test.0":"2022-02-05T00:02:39.500Z","0.3.0":"2022-03-20T00:47:30.250Z","0.3.1":"2022-03-24T03:32:36.225Z","0.3.2-next.0":"2022-04-26T14:45:35.946Z","0.3.2-next.1":"2022-04-26T15:24:53.398Z","0.3.2-next.2":"2022-04-26T15:46:19.410Z","0.3.2-next.3":"2022-04-26T16:10:32.625Z","0.3.2-next.4":"2022-04-26T16:49:34.443Z","0.3.2-next.5":"2022-04-26T19:53:22.442Z","0.3.2":"2022-04-26T20:23:48.758Z","0.3.3":"2022-09-01T23:42:51.339Z"},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"}],"description":"Searches for and loads your tool's JavaScript configuration files with full support for CJS, ESM, TypeScript and more.","homepage":"https://github.com/natemoo-re/proload#readme","keywords":["load","configuration","config","esm","cjs","typescript"],"repository":{"type":"git","url":"git+https://github.com/natemoo-re/proload.git","directory":"packages/core"},"author":{"name":"Nate Moore","email":"nate@natemoo.re"},"bugs":{"url":"https://github.com/natemoo-re/proload/issues"},"license":"MIT","readme":"# `@proload/core`\n\nProload searches for and loads your tool's JavaScript configuration files. Users have complex expectations when it comes to configuration files—the goal of Proload is to offer a single, straightforward and extensible API for loading them.\n\n```js\nimport load from '@proload/core';\n\nawait load('namespace');\n```\n\n> `@proload/core` can be used in `node@12.20.1` and up. It relies on Node's native ESM semantics.\n\n## Motivation\n\nConfiguration files are really difficult to get right. Tool authors tend to think, \"Easy solve! I'll just have everyone use one `namespace.config.js`!\" In most cases that should work, but since `node@12.17.0`, plain `.js` files can be written in either ESM or CJS—both formats are officially supported and can be configured on a per-project basis. Additionally, `node` is able to load any file using a `.cjs` or `.mjs` extension, not just `.js`.\n\nMany popular libraries get these semantics wrong, but maintaining and testing this resolution logic in library code can be a huge maintanence burden. As a library author, you don't need to know (or care) which module format your users choose—you just need to load the contents of the config file. `@proload/core` is a well-tested solution that gets these semantics right, so you can focus on more important things.\n\n> You probably have TypeScript users, too! They would definitely appreciate being able to write a `.ts` config file. `@proload/core` uses a plugin system to load non-JavaScript files. See [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) or [`@proload/plugin-typescript`](https://github.com/natemoo-re/proload/tree/main/packages/core#typescript) specifically.\n\n## Resolution\n\nOut of the box, `@proload/core` searches up the directory tree for the following files:\n\n- a `[namespace].config.js`, `[namespace].config.cjs`, or `[namespace].config.mjs` file\n- any of the `js/cjs/mjs` files inside of `config/` directory\n- a `package.json` file with a top-level `[namespace]` key\n\n\nHere's an overview of all the files supported by default for a tool named `donut`.\n\n```\nawait load('donut');\n\n.\n├── donut.config.js        // Either ESM or CJS supported\n├── donut.config.cjs\n├── donut.config.mjs\n├── config/                // Great for organizing many configs\n│   ├── donut.config.js\n│   ├── donut.config.cjs\n│   └── donut.config.mjs\n└── package.json           // with top-level \"donut\" property\n```\n\n## `resolve`\n\n`resolve` is an additional named export of `@proload/core`. It is an `async` function that resolves **but does not load** a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nresolve(namespace: string, opts?: ResolveOptions);\n```\n\n## `load`\n\nThe `default` export of `@proload/core` is an `async` function to load a configuration file.\n\n- `namespace` is the name of your tool. As an example, `donut` would search for `donut.config.[ext]`.\n- `opts` configure the behavior of `load`. See [Options](https://github.com/natemoo-re/proload/tree/main/packages/core#options).\n\n```ts\nload(namespace: string, opts?: LoadOptions);\n```\n\n\n## Options\n\n### cwd\n`load` searches up the directory tree, beginning from this loaction. Defaults to `process.cwd()`.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project' });\n```\n\n### filePath\nIf you already have the exact (absolute or relative) `filePath` of your user's config file, set the `filePath` option to disable Proload's search algorithm.\n\n```js\nimport load from '@proload/core';\nawait load('namespace', { cwd: '/path/to/user/project', filePath: './custom-user-config.js' });\n```\n\n### mustExist\n`mustExist` controls whether a configuration _must_ be found. Defaults to `true`—Proload will throw an error when a configuration is not found. To customize error handling, you may check the shape of the thrown error. \n\nSetting this option to `false` allows a return value of `undefined` when a configuration is not found.\n\n```js\nimport load, { ProloadError } from '@proload/core';\n\ntry {\n    await load('namespace', { mustExist: true });\n} catch (err) {\n    // Proload couldn't resolve a configuration, log a custom contextual error\n    if (err instanceof ProloadError && err.code === 'ERR_PROLOAD_NOT_FOUND') {\n        console.error(`See the \"namespace\" docs for configuration info`);\n    }\n    throw err;\n}\n```\n\n### context\n\nUsers may want to dynamically generate a different configuration based on some contextual information passed from your tool. Any `{ context }` passed to the `load` function will be forwarded to configuration \"factory\" functions.\n\n```js\n// Library code\nimport load from '@proload/core';\nawait load('namespace', { context: { isDev: true }});\n\n// namespace.config.js\nexport default ({ isDev }) => {\n    return { featureFlag: isDev }\n}\n```\n\n### accept\nIf you need complete control over which file to load, the `accept` handler can customize resolution behavior. A return value of `true` marks a file to be loaded, any other return values (even truthy ones) is ignored.\n\nSee the [`accept`](https://github.com/natemoo-re/proload/blob/34413acf87d98d3ef310ce2873103455cb2eb379/packages/core/lib/index.d.ts#L11) interface.\n\n> Note that [Plugins](https://github.com/natemoo-re/proload/tree/main/packages/core#plugins) are able to modify similar behavior. To load non-JavaScript files, you should use a plugin instead of `accept`.\n\n```js\nimport load from '@proload/core';\n\nawait load('donut', {\n    accept(fileName) {\n        // Support alternative spelling for any European friends\n        return fileName.startsWith('doughnut.config');\n    }\n})\n```\n\nThe following example uses `@proload/plugin-typescript` to add support for loading `.ts` files and an `accept` handler to require all config files to use the `.ts` extension.\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace', {\n    accept(fileName) {\n        // Only accept `.ts` config files\n        return fileName.endsWith('.ts');\n    }\n})\n```\n\n### merge\n\nTo customize `extends` behavior, you may pass a custom `merge` function to the `load` function. By default, [`deepmerge`](https://github.com/TehShrike/deepmerge) is used.\n\n```js\n// Library code\nimport load from '@proload/core';\n\nconst shallowMerge = (a, b) => ({ ...a, ...b })\nawait load('namespace', { merge: shallowMerge });\n\n// namespace.config.js\nexport default {\n    extends: ['./a.js', './b.js']\n}\n\n// a.js\nexport default {\n    a: true\n}\n\n// b.js\nexport default {\n    b: true\n}\n\n// result\n{\n    a: true,\n    b: true\n}\n```\n\n\n## Automatic `extends`\n\nTools like `typescript` and `babel` have popularized the ability to share configuration presets through a top-level `extends` clause. `extends` also allows you to share a local base configuration with other packages, which is extremely useful for monorepo users.\n\nCustom implementation of this behavior can be difficult, so `@proload/core` automatically recognizes top-level `extends` clauses (`string[]`) for you. It recursively resolves and merges all dependent configurations.\n\n```js\n// namespace.config.js\nexport default {\n    extends: ['@namespace/preset', '../namespace.base.config.js']\n}\n```\n\n### Extending local configuration files\nIn many cases, particularly in monorepos, it's useful to have a base configuration file and use `extends` in any sub-packages to inherit the base configuration. `@proload/core` resolves paths in `extends` relative to the configuration file itself.\n\n```\n.\n├── namespace.base.config.js\n└── packages/\n    ├── package-a/\n    │   └── namespace.config.js\n    └── package-b/\n        └── namespace.config.js\n```\n\n### Extending configuration presets\n`@proload/core` uses the same strategy to resolve a configuration file from project `dependencies` as it does for user configurations. When publishing a configuration preset, use the same file naming strategy as you would for local configuration.\n\n```\n.\n├── node_modules/\n│   └── @namespace/\n│       └── preset-env/\n│           ├── package.json\n│           └── namespace.config.js\n├── package.json\n└── namespace.config.js\n```\n\nAssuming `@namespace/preset-env` is a project dependency, the top-level `namespace.config.js` file can use `extends` to reference the dependency.\n\n```js\nexport default {\n    extends: ['@namespace/preset-env']\n}\n```\n\n## Plugins\n\nIn order to support as many use cases as possible, `@proload/core` uses a plugin system. Plugins build on each other and are designed to be combined. For example, to support a `namespacerc.json` file, you could use both `@proload/plugin-json` and `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\nimport json from '@proload/plugin-json';\n\nload.use([rc, json]);\nawait load('namespace');\n```\n\n### TypeScript\nIn order to load a `[namespace].config.ts` file, use `@proload/plugin-typescript`.\n\n```js\nimport load from '@proload/core';\nimport typescript from '@proload/plugin-typescript';\n\nload.use([typescript]);\nawait load('namespace');\n```\n\n### JSON\nIn order to load a `[namespace].config.json` file, use `@proload/plugin-json`.\n\n```js\nimport load from '@proload/core';\nimport json from '@proload/plugin-json';\n\nload.use([json]);\nawait load('namespace');\n```\n\n### YAML\nIn order to load a `[namespace].config.yaml` or `[namespace].config.yml` file, use `@proload/plugin-yaml`.\n\n```js\nimport load from '@proload/core';\nimport yaml from '@proload/plugin-yaml';\n\nload.use([yaml]);\nawait load('namespace');\n```\n\n### RC files\nIn order to load a `[namespace]rc` file with any extension, use `@proload/plugin-rc`.\n\n```js\nimport load from '@proload/core';\nimport rc from '@proload/plugin-rc';\n\nload.use([rc]);\nawait load('namespace');\n```\n\n### All Plugins\nFor illustrative purposes (please don't do this), combining all of these plugins would support the following resolution logic:\n\n```\n.\n├── namespace.config.js\n├── namespace.config.cjs\n├── namespace.config.mjs\n├── namespace.config.ts\n├── namespace.config.json\n├── namespace.config.yaml\n├── namespace.config.yml\n├── namespacerc.js\n├── namespacerc.cjs\n├── namespacerc.mjs\n├── namespacerc.ts\n├── namespacerc.json\n├── namespacerc.yaml\n├── namespacerc.yml\n├── config/\n│   ├── namespace.config.js\n│   ├── namespace.config.cjs\n│   ├── namespace.config.mjs\n│   ├── namespace.config.ts\n│   ├── namespace.config.json\n│   ├── namespace.config.yaml\n│   ├── namespace.config.yml\n│   ├── namespacerc.js\n│   ├── namespacerc.cjs\n│   ├── namespacerc.mjs\n│   ├── namespacerc.ts\n│   ├── namespacerc.json\n│   ├── namespacerc.yaml\n│   └── namespacerc.yml\n└── package.json\n```\n\n## Credits\n\nProload is heavily inspired by tools like [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig#readme) and [`rc`](https://github.com/dominictarr/rc). \n\nProload would not be possible without [@lukeed](https://github.com/lukeed)'s amazing work on [`escalade`](https://github.com/lukeed/escalade) and [`uvu`](https://github.com/lukeed/uvu).\n","readmeFilename":"README.md"}