{"id":13903231,"url":"https://github.com/bent10/rcfy","last_synced_at":"2025-08-06T16:20:13.630Z","repository":{"id":38267819,"uuid":"492476439","full_name":"bent10/rcfy","owner":"bent10","description":"Finds and loads runtime-configuration file for the current project with precedence","archived":false,"fork":false,"pushed_at":"2025-01-05T06:36:52.000Z","size":889,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T22:47:28.900Z","etag":null,"topics":["command","config","configuration","control","fs","load","loader","rc","run","runtime"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rcfy","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bent10.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-15T12:10:34.000Z","updated_at":"2024-10-30T13:16:33.000Z","dependencies_parsed_at":"2023-01-31T19:15:50.438Z","dependency_job_id":"51dc9337-0f56-4267-a55a-70a7e195dac1","html_url":"https://github.com/bent10/rcfy","commit_stats":{"total_commits":166,"total_committers":5,"mean_commits":33.2,"dds":0.2650602409638554,"last_synced_commit":"344ca76f05a76301d85282866c7f812ec12322cb"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bent10%2Frcfy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bent10%2Frcfy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bent10%2Frcfy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bent10%2Frcfy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bent10","download_url":"https://codeload.github.com/bent10/rcfy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248197933,"owners_count":21063623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command","config","configuration","control","fs","load","loader","rc","run","runtime"],"created_at":"2024-08-06T22:01:53.652Z","updated_at":"2025-04-10T09:51:44.758Z","avatar_url":"https://github.com/bent10.png","language":"TypeScript","funding_links":[],"categories":["config"],"sub_categories":[],"readme":"# rcfy\n\nFinds and loads runtime-configuration file for the current project, with precedence.\n\n## Install\n\n```bash\nnpm i rcfy\n# or\nyarn add rcfy\n```\n\n## Usage\n\nThis package is pure ESM, please read the\n[esm-package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\n\n```js\nimport { findRc, loadRc } from 'rcfy'\n\nconst rcFile = await findRc('myproject')\n// =\u003e root/to/project/.myproject.js\n\nconst rc = await loadRc('myproject')\n// =\u003e { ... }\n```\n\n## API\n\n### findRc\n\n▸ **findRc**(`name`, `cwd?`): `Promise`\u003c`string` \\| `undefined`\\\u003e\n\nFinds runtime-configuration file.\n\n```js\nimport { findRc } from 'rcfy'\n\nconst rcFile = await findRc('myproject', './config')\n// will finds:\n// - `.myprojectrc` file in the `./config` directory.\n// - `.myprojectrc.json` file in the `./config` directory.\n// - `.myprojectrc.{yaml,yml}` file in the `./config` directory.\n// - `.myproject.{mjs,cjs,js}` file in the `./config` directory.\n// - `myproject.config.{mjs,cjs,js}` file in the `./config` directory.\n```\n\n#### Parameters\n\n| Name   | Type     |\n| :----- | :------- |\n| `name` | `string` |\n| `cwd`  | `string` |\n\n#### Returns\n\n`Promise`\u003c`string` \\| `undefined`\\\u003e\n\n---\n\n### loadRc\n\n▸ **loadRc**\u003c`T` = `any`\\\u003e(`name`, `cwd?`, ...`args`): `Promise`\u003c`T`\\\u003e\n\nLoads runtime-configuration file, with precedence.\n\n```js\nimport { loadRc } from 'rcfy'\n\nconst rc = await loadRc('myproject')\n// will try to loads config from:\n// - `myproject` field in the `package.json` file.\n// - `.myprojectrc` file in the `cwd`.\n// - `.myprojectrc.json` file in the `cwd`.\n// - `.myprojectrc.{yaml,yml}` file in the `cwd`.\n// - `.myproject.{mjs,cjs,js}` file in the `cwd`.\n// - `myproject.config.{mjs,cjs,js}` file in the `cwd`.\n```\n\n**Note:** Config that found in the `package.json` will be merged with\nhigher precedence.\n\n#### Parameters\n\n| Name      | Type     |\n| :-------- | :------- |\n| `name`    | `string` |\n| `cwd`     | `string` |\n| `...args` | `any`[]  |\n\n#### Returns\n\n`Promise`\u003c`T`\\\u003e\n\n---\n\n### findRcSync\n\n▸ **findRcSync**(`name`, `cwd?`): `string` \\| `undefined`\n\nFinds runtime-configuration file synchronously.\n\n```js\nimport { findRcSync } from 'rcfy'\n\nconst rcFile = findRcSync('myproject', './config')\n// will finds:\n// - `.myprojectrc` file in the `./config` directory.\n// - `.myprojectrc.json` file in the `./config` directory.\n// - `.myprojectrc.{yaml,yml}` file in the `./config` directory.\n// - `.myproject.{cjs,js}` file in the `./config` directory.\n// - `myproject.config.{cjs,js}` file in the `./config` directory.\n```\n\n#### Parameters\n\n| Name   | Type     |\n| :----- | :------- |\n| `name` | `string` |\n| `cwd`  | `string` |\n\n#### Returns\n\n`string` \\| `undefined`\n\n---\n\n### loadRcSync\n\n▸ **loadRcSync**\u003c`T` = `any`\\\u003e(`name`, `cwd?`, ...`args`): `T` \\| `Promise`\u003c`T`\\\u003e\n\nLoads runtime-configuration file synchronously, with precedence.\n\n```js\nimport { loadRcSync } from 'rcfy'\n\nconst rc = loadRcSync('myproject')\n// will try to loads config from:\n// - `myproject` field in the `package.json` file.\n// - `.myprojectrc` file in the `cwd`.\n// - `.myprojectrc.json` file in the `cwd`.\n// - `.myprojectrc.{yaml,yml}` file in the `cwd`.\n// - `.myproject.{cjs,js}` file in the `cwd`.\n// - `myproject.config.{cjs,js}` file in the `cwd`.\n```\n\n**Note:** Config that found in the `package.json` will be merged with\nhigher precedence.\n\n#### Parameters\n\n| Name      | Type     |\n| :-------- | :------- |\n| `name`    | `string` |\n| `cwd`     | `string` |\n| `...args` | `any`[]  |\n\n#### Returns\n\n`T` \\| `Promise`\u003c`T`\\\u003e\n\n## Related\n\n- [`loadee`](https://github.com/bent10/loadee) – A utility to simplify the loading of YAML, JSON, and JS files.\n\n## Contributing\n\nWe 💛\u0026nbsp; issues.\n\nWhen committing, please conform to [the semantic-release commit standards](https://www.conventionalcommits.org/). Please install `commitizen` and the adapter globally, if you have not already.\n\n```bash\nnpm i -g commitizen cz-conventional-changelog\n```\n\nNow you can use `git cz` or just `cz` instead of `git commit` when committing. You can also use `git-cz`, which is an alias for `cz`.\n\n```bash\ngit add . \u0026\u0026 git cz\n```\n\n## License\n\n![GitHub](https://img.shields.io/github/license/bent10/rcfy)\n\nA project by [Stilearning](https://stilearning.com) \u0026copy; 2022-2024.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbent10%2Frcfy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbent10%2Frcfy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbent10%2Frcfy/lists"}