{"id":15044789,"url":"https://github.com/tleunen/find-babel-config","last_synced_at":"2025-03-17T14:15:13.823Z","repository":{"id":9675875,"uuid":"62969817","full_name":"tleunen/find-babel-config","owner":"tleunen","description":"Find the closest babel config based on a directory","archived":false,"fork":false,"pushed_at":"2024-09-02T12:30:48.000Z","size":644,"stargazers_count":13,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T23:15:39.456Z","etag":null,"topics":["babel","config","find"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tleunen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-07-09T21:25:58.000Z","updated_at":"2024-09-02T12:30:51.000Z","dependencies_parsed_at":"2024-04-17T02:45:01.066Z","dependency_job_id":"18fe4a0c-fbe5-4db0-9054-dc7a7dcecd8f","html_url":"https://github.com/tleunen/find-babel-config","commit_stats":{"total_commits":67,"total_committers":11,"mean_commits":6.090909090909091,"dds":0.6567164179104478,"last_synced_commit":"0bc2a172c2aac355f3a4ec06905e0a2825beb65d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2Ffind-babel-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2Ffind-babel-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2Ffind-babel-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2Ffind-babel-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tleunen","download_url":"https://codeload.github.com/tleunen/find-babel-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047646,"owners_count":20389206,"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":["babel","config","find"],"created_at":"2024-09-24T20:51:02.786Z","updated_at":"2025-03-17T14:15:13.798Z","avatar_url":"https://github.com/tleunen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# find-babel-config\n[![npm][npm-version-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coverage Status][coverage-image]][coverage-url]\n\nHelper function to retrieve the closest Babel configuration from a specific directory.\n\n## Installation\n\n```sh\nnpm install --save find-babel-config\n```\n\n## Usage\n\n### Async\n\n```js\n// directory can be an absolute or relative path\n// If it's a relative path, it is relative to the current working directory (process.cwd())\nconst directory = 'src';\nfindBabelConfig(directory).then(({ file, config }) =\u003e {\n    if (file) {\n        // file is the file in which the config is found\n        console.log(file);\n        // config is a JS plain object with the babel config\n        console.log(config);\n    }\n});\n```\n\n### Sync\n\n```js\n// directory can be an absolute or relative path\n// If it's a relative path, it is relative to the current working directory (process.cwd())\nconst directory = 'src';\nconst { file, config } = findBabelConfig.sync(directory);\n// if file === null, the config wasn't found. (Also config === null)\nif (file) {\n    // file is the file in which the config is found\n    console.log(file);\n    // config is a JS plain object with the babel config\n    console.log(config);\n}\n```\n\nA second parameter can be given to `findBabelConfig`, it specifies the `depth` of search. By default, this value is `Infinity` but you can set the value you want: `findBabelConfig('src', 10)`.\n\n## License\n\nMIT, see [LICENSE.md](/LICENSE.md) for details.\n\n[ci-image]: https://circleci.com/gh/tleunen/find-babel-config.svg?style=shield\n[ci-url]: https://circleci.com/gh/tleunen/find-babel-config\n[coverage-image]: https://codecov.io/gh/tleunen/find-babel-config/branch/master/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/tleunen/find-babel-config\n[npm-version-image]: https://img.shields.io/npm/v/find-babel-config.svg\n[npm-url]: https://www.npmjs.com/package/find-babel-config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleunen%2Ffind-babel-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftleunen%2Ffind-babel-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleunen%2Ffind-babel-config/lists"}