# new-github-release-url

> Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields

Latest version **2.0.0** (published 2021-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install new-github-release-url
pnpm add new-github-release-url
yarn add new-github-release-url
bun add new-github-release-url
```

## Health

**Score 43/100 (D)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-10-18 |
| First published | 2018-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/new-github-release-url) |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 120 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | github, release, releases, new, generate, url, gh, query, search, parameters, params |

## Links

- npm: https://www.npmjs.com/package/new-github-release-url
- Repository: https://github.com/sindresorhus/new-github-release-url
- Homepage: https://github.com/sindresorhus/new-github-release-url#readme
- Issues: https://github.com/sindresorhus/new-github-release-url/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/new-github-release-url

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) ^2.5.1

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-10-18
- 1.0.0 — 2019-04-23
- 0.1.0 — 2018-12-02

## README

# new-github-release-url

> Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields

GitHub supports prefilling a new release by setting [certain search parameters](https://github.com/isaacs/github/issues/1410#issuecomment-442240267). This package simplifies generating such URL.

## Install

```sh
$ npm install new-github-release-url
```

## Usage

```js
import newGithubReleaseUrl from 'new-github-release-url';
import open from 'open';

const url = newGithubReleaseUrl({
	user: 'sindresorhus',
	repo: 'new-github-release-url',
	body: '\n\n\n---\nI\'m a human. Please be nice.'
});
//=> 'https://github.com/sindresorhus/new-github-release-url/releases/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'

// Then open it
await open(url);
```

## API

### newGithubReleaseUrl(options)

Returns a URL string.

#### options

Type: `object`

You are required to either specify the `repoUrl` option or both the `user` and `repo` options.

##### repoUrl

Type: `string`

The full URL to the repo.

##### user

Type: `string`

GitHub username or organization.

##### repo

Type: `string`

GitHub repo.

##### tag

Type: `string`

The tag name of the release.

##### target

Type: `string`\
Default: The default branch

The branch name or commit SHA to point the release's tag at, if the tag doesn't already exist.

##### title

Type: `string`

The title of the release.

GitHub shows the `tag` name when not specified.

##### body

Type: `string`

The description text of the release.

##### isPrerelease

Type: `boolean`\
Default: `false`

Whether the release should be marked as a pre-release.

## Related

- [new-github-issue-url](https://github.com/sindresorhus/new-github-issue-url) - Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields

---
_Source: https://npm.io/package/new-github-release-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
