{"id":13394220,"url":"https://github.com/sindresorhus/new-github-issue-url","last_synced_at":"2025-05-15T02:06:12.013Z","repository":{"id":47139813,"uuid":"156346384","full_name":"sindresorhus/new-github-issue-url","owner":"sindresorhus","description":"Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields","archived":false,"fork":false,"pushed_at":"2025-03-09T17:26:29.000Z","size":22,"stargazers_count":242,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-27T05:34:50.779Z","etag":null,"topics":["github","github-issues","npm-package","url"],"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/sindresorhus.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},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2018-11-06T07:53:14.000Z","updated_at":"2025-03-12T07:13:23.000Z","dependencies_parsed_at":"2025-04-10T06:16:53.009Z","dependency_job_id":"f2a73707-cb01-4e11-bce5-ad8e187f39a7","html_url":"https://github.com/sindresorhus/new-github-issue-url","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnew-github-issue-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnew-github-issue-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnew-github-issue-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnew-github-issue-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/new-github-issue-url/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252923838,"owners_count":21825916,"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":["github","github-issues","npm-package","url"],"created_at":"2024-07-30T17:01:12.926Z","updated_at":"2025-05-15T02:06:11.996Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# new-github-issue-url\n\n\u003e Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields\n\nGitHub supports prefilling a new issue by setting [certain search parameters](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue#creating-an-issue-from-a-url-query). This package simplifies generating such URL.\n\n## Install\n\n```sh\nnpm install new-github-issue-url\n```\n\n## Usage\n\n```js\nimport newGithubIssueUrl from 'new-github-issue-url';\nimport open from 'open';\n\nconst url = newGithubIssueUrl({\n\tuser: 'sindresorhus',\n\trepo: 'new-github-issue-url',\n\tbody: '\\n\\n\\n---\\nI\\'m a human. Please be nice.'\n});\n//=\u003e 'https://github.com/sindresorhus/new-github-issue-url/issues/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'\n\n// Then open it\nawait open(url);\n```\n\n[Try the URL](https://github.com/sindresorhus/new-github-issue-url/issues/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.)\\\n*(Don't click the \"Submit new issue\" button!)*\n\nIf you use Electron, check out `electron-util`'s [`openNewGitHubIssue()` method](https://github.com/sindresorhus/electron-util#opennewgithubissueoptions).\n\n## API\n\n### newGithubIssueUrl(options)\n\nReturns a URL string.\n\n#### options\n\nType: `object`\n\nYou are required to either specify the `repoUrl` option or both the `user` and `repo` options.\n\n##### repoUrl\n\nType: `string`\n\nThe full URL to the repo.\n\n##### user\n\nType: `string`\n\nGitHub username or organization.\n\n##### repo\n\nType: `string`\n\nGitHub repo.\n\n##### body\n\nType: `string`\n\nThe issue body.\n\n##### title\n\nType: `string`\n\nThe issue title.\n\n##### template\n\nType: `string`\n\nUse an [issue template](https://help.github.com/articles/manually-creating-a-single-issue-template-for-your-repository/).\n\nFor example, if you want to use a template at `ISSUE_TEMPLATE/unicorn.md`, you would specify `unicorn.md` here.\n\n##### labels\n\nType: `string[]`\n\nThe labels for the issue.\n\n*Requires the user to have the permission to add labels.*\n\n##### milestone\n\nType: `string`\n\nThe milestone for the issue.\n\n*Requires the user to have the permission to add milestone.*\n\n##### assignee\n\nType: `string`\n\nThe user to assign to the issue.\n\n*Requires the user to have the permission to add assignee.*\n\n##### projects\n\nType: `string[]`\n\nThe projects to add the issue to.\n\nThe project reference format is `user/repo/\u003cproject-number\u003e`, for example, if the URL to the project is `https://github.com/sindresorhus/some-repo/projects/3`, the project reference would be `sindresorhus/some-repo/3`.\n\n*Requires the user to have the permission to add projects.*\n\n##### type\n\nType: `string`\n\nThe [issue type](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/editing-an-issue#adding-or-changing-the-issue-type).\n\n## Related\n\n- [new-github-release-url](https://github.com/sindresorhus/new-github-release-url) - Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fnew-github-issue-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fnew-github-issue-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fnew-github-issue-url/lists"}