{"id":18653242,"url":"https://github.com/babel-utils/babel-file-loader","last_synced_at":"2025-06-22T11:08:16.675Z","repository":{"id":50218442,"uuid":"92402352","full_name":"babel-utils/babel-file-loader","owner":"babel-utils","description":"Load files into memory to be parsed \u0026 traversed using Babylon/Babel","archived":false,"fork":false,"pushed_at":"2018-10-14T08:10:08.000Z","size":34,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T11:08:06.032Z","etag":null,"topics":["babel","babel-util","filesystem"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/babel-utils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-25T12:43:52.000Z","updated_at":"2023-10-12T05:43:45.000Z","dependencies_parsed_at":"2022-09-18T00:41:25.600Z","dependency_job_id":null,"html_url":"https://github.com/babel-utils/babel-file-loader","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/babel-utils/babel-file-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-file-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-file-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-file-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-file-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babel-utils","download_url":"https://codeload.github.com/babel-utils/babel-file-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-file-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261282321,"owners_count":23134940,"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","babel-util","filesystem"],"created_at":"2024-11-07T07:10:42.645Z","updated_at":"2025-06-22T11:08:11.656Z","avatar_url":"https://github.com/babel-utils.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-file-loader\n\n\u003e Load files into memory to be parsed \u0026 traversed using [Babylon](https://github.com/babel/babylon)/Babel\n\n```js\nimport {loadImportSync} from 'babel-file-loader';\n\nexport function plugin() {\n  return {\n    visitor: {\n      ImportDefaultDeclaration(path) {\n        let file = loadImportSync(path);\n\n        file.path.traverse({\n          ExportDefaultDeclaration() {\n            console.log('Found matching export default');\n          },\n        });\n      },\n    },\n  },\n};\n```\n\n## API\n\n#### `resolveFilePath{Async,Sync}(path, filePath, resolveOpts)`\n\nResolve a `filePath` relative to the file a `path` belongs to. Returns string.\n\n#### `resolveImportFilePath{Async,Sync}(path, resolveOpts)`\n\nResolve an import declaration `path` to extract a file path. Returns string.\n\n#### `loadFile{Async,Sync}(filePath, parserOpts)`\n\nLoad and parse a file from a `filePath`. Returns [File](https://github.com/babel-utils/babel-file).\n\n#### `loadImport{Async,Sync}(path, resolveOpts, parserOpts)`\n\nLoad and parse a file from an import declaration `path`. Returns [File](https://github.com/babel-utils/babel-file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel-utils%2Fbabel-file-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabel-utils%2Fbabel-file-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel-utils%2Fbabel-file-loader/lists"}