Skip to content

crqrdotcom/gh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

:octocat: gh

Module to use GitHub CLI (aka gh) in Deno. Useful to create extensions using Deno.

Installation

import { gh } from "https://deno.land/x/gh@v0.0.1/mod.ts";

Usage

import { gh } from "https://deno.land/x/gh@v0.0.1/mod.ts";

async function gh(cmd: string, options: Options): Promise<unknown>

Options

interface Options {
  debug?: boolean;
  flags?: Record<string, string | number | boolean | Array<string | number | boolean>>;
  json?: boolean;
}

Example

import { gh } from "./mod.ts";

const repos = await gh("api users/octocat/repos", {
  json: true,
  flags: { paginate: true },
}) as Array<unknown>;

console.log(`@octocat has ${repos.length} repos`);

Permissions

This module requires the --allow-run permission.

Contributing

Please, see CONTRIBUTING.md to learn how you can contribute to this repository.

License

This project is released under the MIT License.

About

Module to use GitHub CLI in Deno.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project