{"id":15763434,"url":"https://github.com/shigma/yml-register","last_synced_at":"2026-02-18T03:35:33.787Z","repository":{"id":57690566,"uuid":"492149984","full_name":"shigma/yml-register","owner":"shigma","description":"Hooks into Node's require function to load `.yaml` and `.yml` files","archived":false,"fork":false,"pushed_at":"2024-02-16T08:11:28.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T18:11:29.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/shigma.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-14T07:57:16.000Z","updated_at":"2023-04-09T03:26:24.000Z","dependencies_parsed_at":"2024-06-18T22:40:16.815Z","dependency_job_id":"a25f1fa1-5861-4453-a0ba-cd1a617df14e","html_url":"https://github.com/shigma/yml-register","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shigma/yml-register","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shigma%2Fyml-register","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shigma%2Fyml-register/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shigma%2Fyml-register/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shigma%2Fyml-register/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shigma","download_url":"https://codeload.github.com/shigma/yml-register/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shigma%2Fyml-register/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-04T11:41:57.686Z","updated_at":"2026-02-18T03:35:28.778Z","avatar_url":"https://github.com/shigma.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yml-register\n\n[![downloads](https://img.shields.io/npm/dm/yml-register?style=flat-square)](https://www.npmjs.com/package/yml-register)\n[![npm](https://img.shields.io/npm/v/yml-register?style=flat-square)](https://www.npmjs.com/package/yml-register)\n[![GitHub](https://img.shields.io/github/license/shigma/yml-register?style=flat-square)](https://github.com/shigma/yml-register/blob/master/LICENSE)\n\nHooks into `require` / `import` to load `.yaml` and `.yml` files.\n\n## Usage\n\n### From CLI\n\nCJS:\n\n```sh\nnode -r yml-register path/to/index.cjs\n```\n\nESM (Node.js 20.6.0 or later):\n\n```sh\nnode --import yml-register path/to/index.mjs\n```\n\n### Manually import\n\nCJS:\n\n```js\nrequire('yml-register')\nrequire('path/to/file.yml') // now it works!\n```\n\nESM:\n\n```js\nimport 'yml-register'\nconst data = await import('path/to/file.yml') // now it works!\n```\n\n### TypeScript support\n\nIn order to fixing the error `Cannot find module 'file.yml' or its corresponding type declarations.` when using `import` statement in TypeScript, we provides a type declaration bundled in this package.\n\nWhat you need is to append `compilerOptions.types` by `yml-register/types` in `tsconfig.json`.\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\n      \"yml-register/types\",\n    ],\n  },\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshigma%2Fyml-register","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshigma%2Fyml-register","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshigma%2Fyml-register/lists"}