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

@ashishalex/dataform-tools

v1.0.9

Published

Wrapper for google-cloud/dataform npm package

Readme

Dataform Tools for Google Cloud Platform

Wrapper for Google Cloud Dataform npm pacakge @google-cloud/dataform that simplifies common operations such as listing repositories, managing workspaces, creating compilation results, and triggering workflow invocations.


Installation

npm install @ashishalex/dataform-tools

Usage

Run Dataform workflow in GCP

Creates a remote Dataform run using code from a git commitish or worksapce

import {DataformTools} from "@ashishalex/dataform-tools"
const client = new DataformTools("your-gcp-project-id", "europe-west2")

const codeCompilationConfig = {} // overrides such as table prefix
const invocationConfig = {
    includedTags: [tagToRun],
    fullyRefreshIncrementalTablesEnabled: false,
    transitiveDependentsIncluded: false,
    transitiveDependenciesIncluded:false
}
const workspaceName = undefined  // use workspace name if you want to compile a workspace.
const gitCommitish = "branch_name" // branch name, tag, commit sha
output = client.runDataformRemotely("repository-name", codeCompilationConfig, invocationConfig, workspaceName, gitCommitish)
console.log(output)

List Repositories

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
const repositories = await client.listRepositories()

List Workspaces

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
const workspaces  = await client.listWorkspaces("repository-name")
console.log(workspaces)

Create Workspace

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
const workspace = await client.createWorkspace("repository-name", "workspace-name")
console.log(workspace)

Get repository

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
const repository = await client.getRepository("repository-name")
console.log(repository)

Create Compilation Result

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")

const codeCompilationConfig = {} // overrides such as table prefix
const workspaceName = undefined  // use workspace name if you want to compile a workspace.
const gitCommitish = "branch_name" // branch name, tag, commit sha
const compilationResult = await client.createCompilationResult("repository-name", codeCompilationConfig, workspaceName, gitCommitish)
console.log(compilationResult)

Compilation Result Actions

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")

const codeCompilationConfig = {} // overrides such as table prefix
const workspaceName = undefined  // use workspace name if you want to compile a workspace.
const gitCommitish = "branch_name" // branch name, tag, commit sha
const compilationResult = await client.createCompilationResult("repository-name", codeCompilationConfig, workspaceName, gitCommitish)
const actions = await client.queryCompilationResultActions(compilationResult.name)
console.log(actions)

Create Workflow Invocation

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")

const codeCompilationConfig = {} // overrides such as table prefix
const workspaceName = undefined  // use workspace name if you want to compile a workspace.
const gitCommitish = "branch_name" // branch name, tag, commit sha
const compilationResult = await client.createCompilationResult("repository-name", codeCompilationConfig, workspaceName, gitCommitish)
if(compilationResult.name){
    const invocationConfig = {
        includedTags: [tagToRun],
        fullyRefreshIncrementalTablesEnabled: false,
        transitiveDependentsIncluded: false,
        transitiveDependenciesIncluded:false
    }
    const workflowInvocation = client.createWorkflowInvocation(repositoryName, compilationResult.name, invocationConfig)
    console.log(workflowInvocation)
    const workflowInvocationId = workflowInvocation.name?.split("/").pop()
    if(workflowInvocationId){
    const workflowInvocationUrl = client.getWorkflowInvocationUrl(repositoryName, workflowInvocationId)
    console.log(workflowInvocationUrl)
}

Write content to a file in workspace

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.writeFile("repository-name", "workspace-name", "relative/path/to/file/in/workspace.sql", "select 1 as a");

Remove file from a workspace

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.removeFile("repository-name", "workspace-name", "relative/path/to/file/in/workspace.sql");

Installs NPM packages in a Dataform workspace.

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.installNpmPackages("repository-name", "workspace-name");

Pull git commits from remote repository to workspace

import {DataformTools} from "@ashishalex/dataform-tools"

const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.pullGitCommits("repository-name", "workspace-name", gitOptions:{"remote-git-branch", "git-user-name", "git-user-email"});

Get git status of the remote workspace

import {DataformTools} from "@ashishalex/dataform-tools"
const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.getWorkspaceGitState("repository-name", "workspace-name")

Reset changes in workspace

import {DataformTools} from "@ashishalex/dataform-tools"
const client = new DataformTools("your-gcp-project-id", "europe-west2")
const paths = [];  // array of file paths to reset. If empty, all changes will be reset.
const clean = true; // If true, untracked files will be removed. Defaults to true.
client.resetWorkspaceChanges("repository-name", "workspace-name", paths, clean)

Fetch Git ahead/behind against a remote branch for a workspace

import {DataformTools} from "@ashishalex/dataform-tools"
const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.fetchGitAheadBehind("repository-name", "workspace-name")

Push workspace commits to git remote repository

import {DataformTools} from "@ashishalex/dataform-tools"
const client = new DataformTools("your-gcp-project-id", "europe-west2")
client.pushWorkspaceCommits("repository-name", "my-worksapce", "workspace-name")