0.3.0 โ€ข Published 14 days ago

prune-github-notifications v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

CLI

prune-github-notifications can be run on the CLI with an auth token for notifications access specified as a GH_TOKEN environment variable:

GH_TOKEN=$(gh auth token) npx prune-github-notifications

CLI Options

Only auth is required, and only if a GH_TOKEN isn't available.

OptionTypeDefaultDescription
--authstringprocess.env.GH_TOKENGitHub authentication token with notifications access.
--bandwidthnumber6Maximum parallel requests to start at once.
--reasonstring[]["subscribed"]Notification reason(s) to filter to.
--titlestring"^chore\(deps\): update .+ to"Notification title regular expression to filter to.
--watchnumber0A seconds interval to continuously re-run this on, if truthy.

For example, providing all options on the CLI:

npx prune-github-notifications --auth $(gh auth token) --bandwidth 10 --reason subscribed --title "^chore.+ update .+ to"

Running in watch mode to clear notifications every ten seconds:

npx prune-github-notifications --auth $(gh auth token) --watch 10

Node.js API

npm i prune-github-notifications
import { pruneGitHubNotifications } from "prune-github-notifications";

await pruneGitHubNotifications({ auth: "gho_..." });

If a process.env.GH_TOKEN is set, then the auth parameter will default to it:

await pruneGitHubNotifications();

Node.js Options

Only auth is required, and only if a GH_TOKEN isn't available.

OptionTypeDefaultDescription
authstringprocess.env.GH_TOKENGitHub authentication token with notifications access.
bandwidthnumber6Maximum parallel requests to start at once.
reasonSet<string>Set {"subscribed"}Notification reason(s) to filter to.
titleRegExp/^chore\(deps\): update .+ to/Notification title regular expression to filter to.

For example, providing all options to the Node.js API:

await pruneGitHubNotifications({
	auth: "gho_...",
	bandwidth: 10,
	reason: subscribed,
	title: "^chore.+ update .+ to",
});

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! ๐Ÿ’–

Contributors

๐Ÿ’™ This package was templated with create-typescript-app.

0.3.0

14 days ago

0.2.1

2 months ago

0.2.0

3 months ago