{"id":15856707,"url":"https://github.com/ambiere/project-root","last_synced_at":"2026-05-02T19:34:17.517Z","repository":{"id":231580089,"uuid":"782122889","full_name":"ambiere/project-root","owner":"ambiere","description":"Zero dependencies utility, that helps you find the root of your project.","archived":false,"fork":false,"pushed_at":"2024-04-05T11:42:08.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-02T13:56:07.832Z","etag":null,"topics":["directory","npm","package-json","parent","path","project","root"],"latest_commit_sha":null,"homepage":"","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/ambiere.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":".github/code_of_conduct.md","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},"funding":{"github":"ambiere"}},"created_at":"2024-04-04T17:21:35.000Z","updated_at":"2024-04-05T08:35:37.000Z","dependencies_parsed_at":"2024-04-05T09:26:35.811Z","dependency_job_id":"3a1917cb-631a-46a8-aab6-9afb42966e1f","html_url":"https://github.com/ambiere/project-root","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":"0.033333333333333326","last_synced_commit":"7cbb093c96cb5f3c02120ebb274ac5b47cd28985"},"previous_names":["ambiere/mziz","ambiere/project-root"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ambiere/project-root","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambiere%2Fproject-root","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambiere%2Fproject-root/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambiere%2Fproject-root/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambiere%2Fproject-root/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ambiere","download_url":"https://codeload.github.com/ambiere/project-root/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambiere%2Fproject-root/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["directory","npm","package-json","parent","path","project","root"],"created_at":"2024-10-05T20:02:39.655Z","updated_at":"2026-05-02T19:34:17.501Z","avatar_url":"https://github.com/ambiere.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ambiere"],"categories":[],"sub_categories":[],"readme":"# project-root\n\n\u003e Tiny and zero dependencies utility, that finds the root of npm project.\n\n[![Release](https://github.com/ambiere/project-root/actions/workflows/main.yml/badge.svg)](https://github.com/ambiere/project-root/actions/workflows/main.yml)\n\n## Install\n\n```bash\nnpm install @ambiere/project-root\n```\n\n## Usage\n\nExample npm project structure:\n\n```txt\n/\n└── root \n   ├── .git\n   ├── package.json\n   └── src\n       ├── types\n       └── index.js\n```\n\nFind the root of the project in `index.js` file:\n\n```js\nimport projectRootDir from \"@ambiere/project-root\"\n\nconst projectRoot = projectRootDir()\nconsole.log(projectRoot) // → /root\n```\n\n## API\n\n### `projectRootDir(dir?)`\n\nReturn the root directory of the npm project or `undefined` if none could be found.\n\n#### dir:\n\nType: `string`\n \nDefault: `process.cwd`\n\nThe directory to start the search.\n\n\n## License\n\n[MIT license][MIT]\n\n[MIT]: https://github.com/ambiere/project-root/blob/main/license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambiere%2Fproject-root","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fambiere%2Fproject-root","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambiere%2Fproject-root/lists"}