{"id":17398458,"url":"https://github.com/vweevers/find-githost","last_synced_at":"2026-01-19T22:31:26.591Z","repository":{"id":40577102,"uuid":"326166490","full_name":"vweevers/find-githost","owner":"vweevers","description":"Get repository info from a directory, package.json, url, npm shorthand or git remote.","archived":false,"fork":false,"pushed_at":"2025-12-01T19:33:46.000Z","size":27,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T09:45:24.608Z","etag":null,"topics":["bitbucket","git","github","gitlab","nodejs","npm-package","repository"],"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/vweevers.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-02T11:18:48.000Z","updated_at":"2025-12-01T19:33:43.000Z","dependencies_parsed_at":"2024-06-21T15:34:10.275Z","dependency_job_id":"38929af4-fe6b-41b6-a4db-4fdf39a458de","html_url":"https://github.com/vweevers/find-githost","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"73024a4f17f0d109b23fb941a24ece83e38fbed4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vweevers/find-githost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ffind-githost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ffind-githost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ffind-githost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ffind-githost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/find-githost/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ffind-githost/sbom","scorecard":{"id":1240226,"data":{"date":"2025-12-01","repo":{"name":"github.com/vweevers/find-githost","commit":"f8289254a5a791e715537a01b98a3c8e8dc28367"},"scorecard":{"version":"v5.4.1-0.20251125161513-488797dbe611","commit":"488797dbe611ab7e16f12d88185cde5e8dc28aca"},"score":4.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/vweevers/find-githost/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/vweevers/find-githost/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/vweevers/find-githost/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/vweevers/find-githost/test.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:19","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:6","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/488797dbe611ab7e16f12d88185cde5e8dc28aca/docs/checks.md#sast"}}]},"last_synced_at":"2025-12-06T03:55:54.224Z","repository_id":40577102,"created_at":"2025-12-06T03:55:54.224Z","updated_at":"2025-12-06T03:55:54.224Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: 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":["bitbucket","git","github","gitlab","nodejs","npm-package","repository"],"created_at":"2024-10-16T14:56:50.825Z","updated_at":"2026-01-19T22:31:26.578Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# find-githost\n\n**Get repository info from a directory, `package.json`, url, npm shorthand or git remote.** Backed by the same URL parser as npm. Supports GitHub, GitLab and BitBucket.\n\n[![npm status](http://img.shields.io/npm/v/find-githost.svg)](https://www.npmjs.org/package/find-githost)\n[![node](https://img.shields.io/node/v/find-githost.svg)](https://www.npmjs.org/package/find-githost)\n![Test](https://github.com/vweevers/find-githost/workflows/Test/badge.svg?branch=main)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\n\n## Usage\n\nGet info from `package.json` or git remote origin, whichever is found first:\n\n```js\nconst Githost = require('find-githost')\nconst githost = Githost.fromDir('.')\n\nconsole.log(githost.type)       // github\nconsole.log(githost.owner)      // vweevers\nconsole.log(githost.name)       // find-githost\nconsole.log(githost.ssh())      // git@github.com:vweevers/find-githost.git\nconsole.log(githost.https())    // https://github.com/vweevers/find-githost.git\nconsole.log(githost.homepage()) // https://github.com/vweevers/find-githost\n```\n\nGet info from URL or npm shorthands:\n\n```js\nconst githost = Githost.fromUrl('vweevers/find-githost#d6aeb7c')\n\nconsole.log(githost.toString())\nconsole.log(githost.browse('README.md'))\nconsole.log(githost.browse('CHANGELOG.md', { committish: 'v1.0.0' }))\n```\n\n```\nvweevers/find-githost#d6aeb7c\nhttps://github.com/vweevers/find-githost/tree/d6aeb7c/README.md\nhttps://github.com/vweevers/find-githost/tree/v1.0.0/CHANGELOG.md\n```\n\n## API\n\n### Factories\n\n#### `githost = Githost.fromUrl(url[, options])`\n\nGet info from a URL or npm shortcut. Recognizes Git, SSH and HTTPS urls, as well as shortcuts (`github:vweevers/find-githost`) and for GitHub specifically, the shorter form `vweevers/find-githost`. Options:\n\n- `committish` (string or boolean): if a string, override the committish of input. If `false`, strip committish.\n- `defaultBranch` (string, default `main`): branch name to use for files and tarballs when committish is not present\n- `optional` (boolean, default false): if no valid URL is found, return `null` instead of throwing an error.\n\nThe `committish` and `defaultBranch` options can also be set per method. See the documentation of methods below, which should also clarify when these options apply.\n\n#### `githost = Githost.fromDir(cwd[, options])`\n\nGet info from `package.json` or git remote origin in the `cwd` directory, whichever is found first.  Options:\n\n- `roam` (boolean, default false): look in parent directories too\n- Other options are passed on to `fromUrl()`.\n\n#### `githost = Githost.fromPkg(cwd[, options])`\n\nGet info from the [`repository`][repository] field of a `package.json` in the `cwd` directory. Options:\n\n- `roam` (boolean, default false): look in parent directories too\n- Other options are passed on to `fromUrl()`.\n\n#### `githost = Githost.fromPkg(pkg[, options])`\n\nGet info from the [`repository`][repository] field of a parsed `package.json` object. Options are passed on to `fromUrl()`.\n\n#### `githost = Githost.fromGit(cwd[, options])`\n\nGet info from git remote origin (taken from local git config). Options:\n\n- `roam` (boolean, default false): look in parent directories too\n- Other options are passed on to `fromUrl()`.\n\n### Properties\n\n#### `githost.type`\n\nString, one of `github`, `gist`, `gitlab` or `bitbucket`.\n\n#### `githost.owner`\n\nString, repository owner.\n\n#### `githost.name`\n\nString, repository name.\n\n#### `githost.committish`\n\nString if committish is present, else `null`.\n\n#### `githost.format`\n\nString, original format of input URL, one of `shortcut`, `slug`, `https`, `ssh`, `sshurl` or `git`.\n\n#### `githost.raw`\n\nString, original input URL.\n\n#### `githost.hostname`\n\nString, domain of remote, e.g. `github.com` for type `github`.\n\n### Methods\n\n#### `githost.shortcut([options])`\n\nReturns an npm-style shortcut in the form of `type:owner/name(#committish)`. Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.slug([options])`\n\nReturns an npm-style shortcut for GitHub repositories in the form of `owner/name(#committish)`.  Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.https([options])`\n\nReturns Git URL for HTTPS protocol in the form of `https://hostname/owner/name.git(#committish)`, for example `https://github.com/vweevers/find-githost.git`. Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.ssh([options])`\n\nReturns Git URL for SSH protocol in the short form of `git@hostname:owner/name.git(#committish)`, for example `git@github.com:vweevers/find-githost.git`.  Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.sshurl([options])`\n\nReturns Git URL for SSH protocol in the long form of `ssh://git@hostname/owner/name.git(#committish)`, for example `ssh://git@github.com/vweevers/find-githost.git`.  Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.git([options])`\n\nReturns Git URL for Git protocol in the form of `git://hostname/owner/name.git(#committish)`, for example `git://github.com/vweevers/find-githost.git`.  Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n#### `githost.homepage()`\n\nReturns HTTP(S) URL of homepage, for example `https://github.com/vweevers/find-githost`.\n\n#### `githost.bugs()`\n\nReturns HTTP(S) URL of issue tracker, for example `https://github.com/vweevers/find-githost/issues`.\n\n#### `githost.browse([path][, fragment][, options])`\n\nReturns HTTP(S) URL for browsing a file or directory. For example `https://github.com/vweevers/find-githost/tree/main/README.md#usage` given path `README.md` and fragment `#usage`. For the top-most directory, omit the `path` argument or use `/`. Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, use default branch.\n- `defaultBranch` (string, default `main`): branch name to use when committish is not present.\n\n#### `githost.file(path[, options])`\n\nReturns HTTP(S) URL for the raw contents of `path`, for example `https://raw.githubusercontent.com/vweevers/find-githost/main/index.js` given path `index.js`. Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, use default branch.\n- `defaultBranch` (string, default `main`): branch name to use when committish is not present.\n\n#### `githost.tarball([options])`\n\nReturns HTTP(S) tarball URL, for example `https://codeload.github.com/vweevers/find-githost/tar.gz/v1.0.0` given committish `v1.0.0`. Options:\n\n- `committish` (string or boolean): if a string, override committish. If `false`, use default branch.\n- `defaultBranch` (string, default `main`): branch name to use when committish is not present.\n\n#### `githost.toString([options])`\n\nReturns a string representation. Options:\n\n- `format` (string, defaults to format of input): one of `shortcut`, `slug`, `https`, `ssh`, `sshurl`, `git`.\n- `committish` (string or boolean): if a string, override committish. If `false`, strip committish.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install find-githost\n```\n\n## License\n\n[MIT](LICENSE) © Vincent Weevers\n\n[repository]: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#repository\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ffind-githost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Ffind-githost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ffind-githost/lists"}