Package Exports
- new-github-issue-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (new-github-issue-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
new-github-issue-url 
Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields
GitHub supports prefilling a new issue by setting certain search parameters. This package simplifies generating such URL.
Install
$ npm install new-github-issue-url
Usage
const newGithubIssueUrl = require('new-github-issue-url');
const opn = require('opn');
const url = newGithubIssueUrl({
user: 'sindresorhus',
repo: 'new-github-issue-url',
body: '\n\n\n---\nI\'m a human. Please be nice.'
});
//=> 'https://github.com/sindresorhus/new-github-issue-url/issues/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'
// Then open it
opn(url);
Try the URL
(Don't click the "Submit new issue" button!)
Or with Electron:
const {shell} = require('electron');
shell.openExternal(url);
API
newGithubIssueUrl(options)
Returns a URL string.
options
Type: Object
user
Required
Type: string
GitHub username or organization.
repo
Required
Type: string
GitHub repo.
body
Type: string
The issue body.
title
Type: string
The issue title.
template
Type: string
Use an issue template.
For example, if you want to use a template at ISSUE_TEMPLATE/unicorn.md
, you would specify unicorn.md
here.
labels
Type: string[]
The labels for the issue.
Requires the user to have the permission to add labels.
milestone
Type: string
The milestone for the issue.
Requires the user to have the permission to add milestone.
assignee
Type: string
The user to assign to the issue.
Requires the user to have the permission to add assignee.
projects
Type: string[]
The projects to add the issue to.
The project reference format is user/<project-number>
, for example, if the URL to the project is https://github.com/sindresorhus/some-repo/projects/3
, the project reference would be some-repo/3
.
Requires the user to have the permission to add projects.
License
MIT © Sindre Sorhus