npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ghats

v0.10.3

Published

GitHub Actions with TypeScript

Readme

GitHub Actions with TypeScript

NPM Version GitHub Actions Workflow Status codecov GitHub License

[!WARNING] This is an experimental project. Please use with caution in production environments.

// .github/workflows/hello.ts
import { Workflow, Job } from "ghats";

const workflow = new Workflow("Hello", {
  on: "push",
});

workflow.addJob(
  new Job("hello", {
    runsOn: "ubuntu-latest",
  })
    .uses("actions/checkout@v4")
    .run("echo 'Hello, world!'"),
);

export default workflow;

Installation

$ npm install -D ghats

Getting Started

Create workflow in .github/workflows/*.ts using the ghats.

// .github/workflows/hello.ts
import { Workflow, Job } from "ghats";

const workflow = new Workflow("Hello", {
  on: "push",
});

workflow.addJob(
  new Job("hello", {
    runsOn: "ubuntu-latest",
  })
    .uses("actions/checkout@v4")
    .run("echo 'Hello, world!'"),
);

export default workflow; // NOTE: don't forget this line

Run ghats build to build GitHub Actions Workflow files as .github/workflows/*.yml.

$ npx ghats build

That's all you need to know for basic usage!

Type Support for Remote Actions

Run the ghats install command with the target action specified.

$ npx ghats install actions/checkout

Then you can import the action function from ghats.
The action function provides type support for installed actions and their inputs.

// .github/workflows/hello.ts
import { Workflow, Job, action } from "ghats";

// ...

workflow.addJob(
  new Job("hello", { /* ... */ })
    .uses(
      // ↓↓ Like this! ↓↓
      action("actions/checkout", {
        with: { "persist-credentials": "false" },
      }),
    )
    // ...
);

// ...

Installed actions are recorded in .github/workflows/action.json and .github/workflows/actions-lock.json.

Files Ignored During Build

By default, ghats build builds all .github/workflows/*.ts files, but ignores files that start with _ (e.g. .github/workflows/_helpers.ts).
It's recommended to write common utilities and non-workflow code in these ignored files.

Configuring GitHub API Token

The ghats install command uses the GitHub API internally.
If you're using remote actions from private repositories or want to pass a GitHub API token to avoid rate limits, set the GITHUB_TOKEN environment variable.

$ GITHUB_TOKEN="<YOUR_GITHUB_TOKEN>" npx ghats install

Updating actions.json and actions-lock.json with Renovate

ghats records the versions of installed remote actions in .github/workflows/actions.json and .github/workflows/actions-lock.json.
To automatically update these remote action versions with Renovate, add "github>koki-develop/ghats" to the extends in your configuration file.

// renovate.json
{
  "extends": ["github>koki-develop/ghats"]
}

[!NOTE] Note that after updating actions.json and actions-lock.json, you need to rebuild your workflows.

License

MIT