• Stars
    star
    5,280
  • Rank 7,440 (Top 0.2 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Wireit upgrades your npm/pnpm/yarn scripts to make them smarter and more efficient.
wireit

Wireit upgrades your npm scripts to make them smarter and more efficient.

Published on npm Build Status Discord

Features

  • 🙂 Use the npm run commands you already know
  • ⛓️ Automatically run dependencies between npm scripts in parallel
  • 👀 Watch any script and continuously re-run on changes
  • 🥬 Skip scripts that are already fresh
  • ♻️ Cache output locally and remotely on GitHub Actions for free
  • 🛠️ Works with single packages, npm workspaces, and other monorepos
  • ✏️ VSCode plugin gives suggestions, documentation, and warnings as you develop

Contents

Install

npm i -D wireit

Setup

Wireit works with npm run, it doesn't replace it. To configure an NPM script for Wireit, move the command into a new wireit section of your package.json, and replace the original script with the wireit command.

Before After
{
  "scripts": {
    "build": "tsc"
  }
}
{
  "scripts": {
    "build": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc"
    }
  }
}

Now when you run npm run build, Wireit upgrades the script to be smarter and more efficient. Wireit works with yarn (both 1.X "Classic" and its successor "Berry") and pnpm, too.

You should also add .wireit to your .gitignore file. Wireit uses the .wireit directory to store caches and other data for your scripts.

echo .wireit >> .gitignore

VSCode Extension

If you use VSCode, consider installing the google.wireit extension. It adds documentation on hover, autocomplete, can diagnose a number of common mistakes, and even suggest a refactoring to convert an npm script to use wireit.

Install it from the marketplace or on the command line like:

code --install-extension google.wireit

Discord

Join the Wireit Discord to chat with the Wireit community and get support for your project.

Discord

Dependencies

To declare a dependency between two scripts, edit the wireit.<script>.dependencies list:

{
  "scripts": {
    "build": "wireit",
    "bundle": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc"
    },
    "bundle": {
      "command": "rollup -c",
      "dependencies": ["build"]
    }
  }
}

Now when you run npm run bundle, the build script will automatically run first.

Vanilla scripts

The scripts you depend on don't need to be configured for Wireit, they can be vanilla npm scripts. This lets you only use Wireit for some of your scripts, or to upgrade incrementally. Scripts that haven't been configured for Wireit are always safe to use as dependencies; they just won't be fully optimized.

Wireit-only scripts

It is valid to define a script in the wireit section that is not in the scripts section, but such scripts can only be used as dependencies from other wireit scripts, and can never be run directly.

Cross-package dependencies

Dependencies can refer to scripts in other npm packages by using a relative path with the syntax <relative-path>:<script-name>. All cross-package dependencies should start with a ".". Cross-package dependencies work well for npm workspaces, as well as in other kinds of monorepos.

{
  "scripts": {
    "build": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc",
      "dependencies": ["../other-package:build"]
    }
  }
}

Parallelism

Wireit will run scripts in parallel whenever it is safe to do so according to the dependency graph.

For example, in this diagram, the B and C scripts will run in parallel, while the A script won't start until both B and C finish.

graph TD
  A-->B;
  A-->C;
  subgraph parallel
    B;
    C;
  end

By default, Wireit will run up to 2 scripts in parallel for every logical CPU core detected on your system. To change this default, set the WIREIT_PARALLEL environment variable to a positive integer, or infinity to run without a limit. You may want to lower this number if you experience resource starvation in large builds. For example, to run only one script at a time:

export WIREIT_PARALLEL=1
npm run build

If two or more separate npm run commands are run for the same Wireit script simultaneously, then only one instance will be allowed to run at a time, while the others wait their turn. This prevents coordination problems that can result in incorrect output files being produced. If output is set to an empty array, then this restriction is removed.

Extra arguments

As with plain npm scripts, you can pass extra arguments to a Wireit script by placing a -- double-dash argument in front of them. Any arguments after a -- are sent to the underlying command, instead of being interpreted as arguments to npm or Wireit:

npm run build -- --verbose

Input and output files

The files and output properties of wireit.<script> tell Wireit what your script's input and output files are, respectively. They should be arrays of glob patterns, where paths are interpreted relative to the package directory. They can be set on some, all, or none of your scripts.

Setting these properties allow you to use more features of Wireit:

Requires
files
Requires
output
Dependency graph - -
Watch mode ☑️ -
Clean build - ☑️
Incremental build ☑️ ☑️
Caching ☑️ ☑️

Example configuration

{
  "scripts": {
    "build": "wireit",
    "bundle": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc",
      "files": ["src/**/*.ts", "tsconfig.json"],
      "output": ["lib/**"]
    },
    "bundle": {
      "command": "rollup -c",
      "dependencies": ["build"],
      "files": ["rollup.config.json"],
      "output": ["dist/bundle.js"]
    }
  }
}

Default excluded paths

By default, the following folders are excluded from the files and output arrays:

  • .git/
  • .hg/
  • .svn/
  • .wireit/
  • .yarn/
  • CVS/
  • node_modules/

In the highly unusual case that you need to reference a file in one of those folders, set allowUsuallyExcludedPaths: true to remove all default excludes.

Incremental build

Wireit can automatically skip execution of a script if nothing has changed that would cause it to produce different output since the last time it ran. This is called incremental build.

To enable incremental build, configure the input and output files for each script by specifying glob patterns in the wireit.<script>.files and wireit.<script>.output arrays.

ℹ️ If a script doesn't have a files or output list defined at all, then it will always run, because Wireit doesn't know which files to check for changes. To tell Wireit it is safe to skip execution of a script that definitely has no input and/or files, set files and/or output to an empty array (files: [], output: []).

Caching

If a script has previously succeeded with the same configuration and input files, then Wireit can copy the output from a cache, instead of running the command. This can significantly improve build and test time.

To enable caching for a script, ensure you have defined both the files and output arrays.

ℹ️ If a script doesn't produce any output files, it can still be cached by setting output to an empty array ("output": []). Empty output is common for tests, and is useful because it allows you to skip running tests if they previously passed with the exact same inputs.

Local caching

In local mode, Wireit caches output files to the .wireit folder inside each of your packages.

Local caching is enabled by default, unless the CI=true environment variable is detected. To force local caching, set WIREIT_CACHE=local. To disable local caching, set WIREIT_CACHE=none.

⚠️ Wireit does not currently limit the size of local caches. To free up this space, use rm -rf .wireit/*/cache. Automatic cache size limits will be added in an upcoming release, tracked at wireit#71.

GitHub Actions caching

In GitHub Actions mode, Wireit caches output files to the GitHub Actions cache service. This service is available whenever running in GitHub Actions, and is free for all GitHub users.

ℹ️ GitHub Actions cache entries are automatically deleted after 7 days, or if total usage exceeds 10 GB (the least recently used cache entry is deleted first). See the GitHub Actions documentation for more details.

To enable caching on GitHub Actions, add the following uses clause to your workflow. It can appear anywhere before the first npm run or npm test command:

- uses: google/wireit@setup-github-actions-caching/v1

Example workflow

# File: .github/workflows/tests.yml

name: Tests
on: [push, pull_request]
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: npm

      # Set up GitHub Actions caching for Wireit.
      - uses: google/wireit@setup-github-actions-caching/v1

      # Install npm dependencies.
      - run: npm ci

      # Run tests. Wireit will automatically use
      # the GitHub Actions cache whenever possible.
      - run: npm test

Cleaning output

Wireit can automatically delete output files from previous runs before executing a script. This is helpful for ensuring that every build is clean and free from outdated files created in previous runs from source files that have since been removed.

Cleaning is enabled by default as long as the output array is defined. To change this behavior, set the wireit.<script>.clean property to one of these values:

Setting Description
true Clean before every run (the default).
"if-file-deleted" Clean only if an input file has been deleted since the last run.

Use this option for tools that have incremental build support, but do not clean up outdated output when a source file has been deleted, such as tsc --build (see TypeScript for more on this example.)
false Do not clean.

Only use this option if you are certain that the script command itself already takes care of removing outdated files from previous runs.

Watch mode

In watch mode, Wireit monitors all files of a script, and all files of its transitive dependencies, and when there is a change, it re-runs only the affected scripts. To enable watch mode, ensure that the files array is defined, and add the --watch flag:

npm run <script> --watch

The benefit of Wireit's watch mode over built-in watch modes are:

  • Wireit watches the entire dependency graph, so a single watch command replaces many built-in ones.
  • It prevents problems that can occur when running many separate watch commands simultaneously, such as build steps being triggered before all preceding steps have finished.

Environment variables

Use the env setting to either directly set environment variables, or to indicate that an externally-defined environment variable affects the behavior of a script.

Setting environment variables directly

If a property value in the env object is a string, then that environment variable will be set to that value when the script's command runs, overriding any value from the parent process.

Unlike built-in shell environment variable syntaxes, using env to set environment variables works the same in macOS/Linux vs Windows, and in all shells.

Note Setting an environment variable with env does not apply transitively through dependencies. If you need the same environment variable to be set for multiple scripts, you must configure it for each of them.

{
  "wireit": {
    "my-script": {
      "command": "my-command",
      "env": {
        "MY_VARIABLE": "my value"
      }
    }
  }
}

Indicating external environment variables

If an environment variable affects the behavior of a script but is set externally (i.e. it is passed to the wireit parent process), set the env property to {"external": true}. This tells Wireit that if the value of an environment variable changes across executions of a script, then its output should not be re-used.

{
  "wireit": {
    "my-script": {
      "command": "my-command",
      "env": {
        "MY_VARIABLE": {
          "external": true
        }
      }
    }
  }
}

Services

By default, Wireit assumes that your scripts will eventually exit by themselves. This is well suited for build and test scripts, but not for long-running processes like servers. To tell Wireit that a process is long-running and not expected to exit by itself, set "service": true.

{
  "scripts": {
    "start": "wireit",
    "build:server": "wireit"
  },
  "wireit": {
    "start": {
      "command": "node my-server.js",
      "service": true,
      "files": ["my-server.js"],
      "dependencies": [
        "build:server",
        {
          "script": "../assets:build",
          "cascade": false
        }
      ]
    },
    "build:server": {
      ...
    }
  }
}

Service lifetime

If a service is run directly (e.g. npm run serve), then it will stay running until the user kills Wireit (e.g. Ctrl-C).

If a service is a dependency of one or more other scripts, then it will start up before any depending script runs, and will shut down after all depending scripts finish.

Service readiness

By default, a service is considered ready as soon as its process spawns, allowing any scripts that depend on that service to start.

However, often times a service needs to perform certain actions before it is safe for dependents to interact with it, such as starting a server and listening on a network interface.

Use service.readyWhen.lineMatches to tell Wireit to monitor the stdout and stderr of the service and defer readiness until a line is printed that matches the given regular expression.

{
  "command": "node my-server.js",
  "service": {
    "readyWhen": {
      "lineMatches": "Server listening on port \\d+"
    }
  }
}

Service restarts

In watch mode, a service will be restarted whenever one of its input files or dependencies change, except for dependencies with cascade set to false.

Service output

Services cannot have output files, because there is no way for Wireit to know when a service has finished writing its output.

If you have a service that produces output, you should define a non-service script that depends on it, and which exits when the service's output is complete.

Execution cascade

By default, a script always needs to run (or restart in the case of services) if any of its dependencies needed to run, regardless of whether the dependency produced new or relevant output.

This automatic cascade of script execution is the default behavior because it ensures that any possible output produced by a dependent script propagates to all other scripts that might depend on it. In other words, Wireit does not assume that the files array completely describes the inputs to a script with dependencies.

Disabling cascade

This execution cascade behavior can be disabled by expanding a dependency into an object, and setting the cascade property to false:

Note What really happens under the hood is that the cascade property simply controls whether the fingerprint of a script includes the fingerprints of its dependencies, which in turn determines whether a script needs to run or restart.

{
  "dependencies": [
    {
      "script": "foo",
      "cascade": false
    }
  ]
}

Reasons to disable cascade

There are two main reasons you might want to set cascade to false:

  1. Your script only consumes a subset of a dependency's output.

    For example, tsc produces both .js files and .d.ts files, but only the .js files might be consumed by rollup. There is no need to re-bundle when a typings-only changed occurred.

    Note In addition to setting cascade to false, the subset of output that does matter (lib/**/*.js) has been added to the files array.

    {
      "scripts": {
        "build": "wireit",
        "bundle": "wireit"
      },
      "wireit": {
        "build": {
          "command": "tsc",
          "files": ["src/**/*.ts", "tsconfig.json"],
          "output": ["lib/**"]
        },
        "bundle": {
          "command": "rollup -c",
          "dependencies": [
            {
              "script": "build",
              "cascade": false
            }
          ],
          "files": ["rollup.config.json", "lib/**/*.js"],
          "output": ["dist/bundle.js"]
        }
      }
    }
  2. Your server doesn't need to restart for certain changes.

    For example, a web server depends on some static assets, but the server reads those assets from disk dynamically on each request. In watch mode, there is no need to restart the server when the assets change.

    Note The build:server dependency uses the default cascade behavior (true), because changing the implementation of the server itself does require the server to be restarted.

    {
      "scripts": {
        "start": "wireit",
        "build:server": "wireit"
      },
      "wireit": {
        "start": {
          "command": "node lib/server.js",
          "service": true,
          "dependencies": [
            "build:server",
            {
              "script": "../assets:build",
              "cascade": false
            }
          ],
          "files": ["lib/**/*.js"]
        },
        "build:server": {
          "command": "tsc",
          "files": ["src/**/*.ts", "tsconfig.json"],
          "output": ["lib/**"]
        }
      }
    }

Failures and errors

By default, when a script fails (meaning it returned with a non-zero exit code), all scripts that are already running are allowed to finish, but new scripts are not started.

In some situations a different behavior may be better suited. There are 2 additional modes, which you can set with the WIREIT_FAILURES environment variable. Note that Wireit always ultimately exits with a non-zero exit code if there was a failure, regardless of the mode.

Continue

When a failure occurs in continue mode, running scripts continue, and new scripts are started as long as the failure did not affect their dependencies. This mode is useful if you want a complete picture of which scripts are succeeding and which are failing.

WIREIT_FAILURES=continue

Kill

When a failure occurs in kill mode, running scripts are immediately killed, and new scripts are not started. This mode is useful if you want to be notified as soon as possible about any failures.

WIREIT_FAILURES=kill

Package locks

By default, Wireit automatically treats package manager lock files as input files (package-lock.json for npm, yarn.lock for yarn, and pnpm-lock.yaml for pnpm). Wireit will look for these lock files in the script's package, and all parent directories.

This is useful because installing or upgrading your dependencies can affect the behavior of your scripts, so it's important to re-run them whenever your dependencies change.

To change the name of the package lock file Wireit should look for, specify it in the wireit.<script>.packageLocks array. You can specify multiple filenames here, if needed.

{
  "scripts": {
    "build": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc",
      "files": ["src/**/*.ts", "tsconfig.json"],
      "output": ["lib/**"],
      "packageLocks": ["another-package-manager.lock"]
    }
  }
}

If you're sure that a script isn't affected by dependencies at all, you can turn off this behavior entirely to improve your cache hit rate by setting wireit.<script>.packageLocks to [].

Recipes

This section contains advice about integrating specific build tools with Wireit.

TypeScript

{
  "scripts": {
    "ts": "wireit"
  },
  "wireit": {
    "ts": {
      "command": "tsc --build --pretty",
      "clean": "if-file-deleted",
      "files": ["src/**/*.ts", "tsconfig.json"],
      "output": ["lib/**", ".tsbuildinfo"]
    }
  }
}
  • Set "incremental": true and use --build to enable incremental compilation, which significantly improves performance.
  • Include .tsbuildinfo in output so that it is reset on clean builds. Otherwise tsc will get out of sync and produce incorrect output.
  • Set "clean": "if-file-deleted" so that you get fast incremental compilation when sources are changed/added, but also stale outputs are cleaned up when a source is deleted (tsc does not clean up stale outputs by itself).
  • Include tsconfig.json in files so that changing your configuration re-runs tsc.
  • Use --pretty to get colorful output despite not being attached to a TTY.

ESLint

{
  "scripts": {
    "lint": "wireit"
  },
  "wireit": {
    "lint": {
      "command": "eslint --color --cache --cache-location .eslintcache .",
      "files": ["src/**/*.ts", ".eslintignore", ".eslintrc.cjs"],
      "output": []
    }
  }
}
  • Use --cache so that eslint only lints the files that were added or changed since the last run, which significantly improves performance.
  • Use --color to get colorful output despite not being attached to a TTY.
  • Include config and ignore files in files so that changing your configuration re-runs eslint.

Reference

Configuration

The following properties can be set inside wireit.<script> objects in package.json files:

Property Type Default Description
command string undefined The shell command to run.
dependencies string[] | object[] [] Scripts that must run before this one.
dependencies[i].script string undefined The name of the script, when the dependency is an object..
dependencies[i].cascade boolean true Whether this dependency always causes this script to re-execute.
files string[] undefined Input file glob patterns, used to determine the fingerprint.
output string[] undefined Output file glob patterns, used for caching and cleaning.
clean boolean | "if-file-deleted" true Delete output files before running.
env Record<string, string | object> false Environment variables to set when running this command, or that are external and affect the behavior.
env[i].external true | undefined undefined true if an environment variable is set externally and affects the script's behavior.
service boolean false Whether this script is long-running, e.g. a server.
packageLocks string[] ['package-lock.json'] Names of package lock files.

Dependency syntax

The following syntaxes can be used in the wireit.<script>.dependencies array:

Example Description
foo Script named "foo" in the same package.
../foo:bar Script named "bar" in the package found at ../foo (details).

Environment variable reference

The following environment variables affect the behavior of Wireit:

Variable Description
WIREIT_FAILURES How to handle script failures.

Options:
  • no-new (default): Allow running scripts to finish, but don't start new ones.
  • continue: Allow running scripts to continue, and start new ones unless any of their dependencies failed.
  • kill: Immediately kill running scripts, and don't start new ones.
WIREIT_PARALLEL Maximum number of scripts to run at one time.

Defaults to 2×logical CPU cores.

Must be a positive integer or infinity.
WIREIT_CACHE Caching mode.

Defaults to local unless CI is true, in which case defaults to none.

Automatically set to github by the google/wireit@setup-github-actions-caching/v1 action.

Options:
  • local: Cache to local disk.
  • github: Cache to GitHub Actions.
  • none: Disable caching.
CI Affects the default value of WIREIT_CACHE.

Automatically set to true by GitHub Actions and most other CI (continuous integration) services.

Must be exactly true. If unset or any other value, interpreted as false.
WIREIT_MAX_OPEN_FILES Limits the number of file descriptors Wireit will have open concurrently. Prevents resource exhaustion when checking large numbers of cached files. Set to a lower number if you hit file descriptor limits.

Glob patterns

The following glob syntaxes are supported in the files and output arrays:

Example Description
foo The file named foo, or if foo is a directory, all recursive children of foo.
foo/*.js All files directly in the foo/ directory which end in .js.
foo/**/*.js All files in the foo/ directory, and all recursive subdirectories, which end in .js.
foo.{html,js} Files named foo.html or foo.js.
!foo Exclude the file or directory foo from previous matches.

Also note these details:

  • Paths should always use / (forward-slash) delimiters, even on Windows.
  • Paths are interpreted relative to the current package even if there is a leading / (e.g. /foo is the same as foo).
  • Whenever a directory is matched, all recursive children of that directory are included.
  • files are allowed to reach outside of the current package using e.g. ../foo. output files cannot reference files outside of the current package.
  • Symlinks in input files are followed, so that they are identified by their content.
  • Symlinks in output files are cached as symlinks, so that restoring from cache doesn't create unnecessary copies.
  • The order of !exclude patterns is significant.
  • Hidden/dot files are matched by * and **.
  • Patterns are case-sensitive (if supported by the filesystem).

Fingerprint

The following inputs determine the fingerprint for a script. This value is used to determine whether a script can be skipped for incremental build, and whether its output can be restored from cache.

  • The command setting.
  • The extra arguments set on the command-line.
  • The clean setting.
  • The output glob patterns.
  • The SHA256 content hashes of all files matching files.
  • The SHA256 content hashes of all files matching packageLocks in the current package and all parent directories.
  • The environment variable values configured in env.
  • The system platform (e.g. linux, win32).
  • The system CPU architecture (e.g. x64).
  • The system Node version (e.g. 16.7.0).
  • The fingerprint of all transitive dependencies, unless cascade is set to false.

When using GitHub Actions caching, the following input also affects the fingerprint:

  • The ImageOS environment variable (e.g. ubuntu20, macos11).

Requirements

Wireit is supported on Linux, macOS, and Windows.

Wireit is supported on Node Current (19), LTS (18), and Maintenance (16 and 14). See Node releases for the schedule.

Warning Wireit will no longer work with Node 14 when it reaches end-of-life on 2023-04-30. We recommend upgrading to Node 18 as soon as possible.

Wireit is supported on the npm versions that ship with the latest versions of the above supported Node versions (6 and 8), Yarn Classic (1), Yarn Berry (3), and pnpm (7).

Related tools

Wireit shares a number of features with these other great tools, and we highly recommend you check them out too:

Here are some things you might especially like about Wireit:

  • Feels like npm. When you use Wireit, you'll continue typing the same npm commands you already use, like npm run build and npm test. There are no new command-line tools to learn, and there's only one way to run each script. Your script config stays in your package.json, too. Wireit is designed to be the minimal addition to npm needed to get script dependencies and incremental build.

  • Caching with GitHub Actions. Wireit supports caching build artifacts and test results directly through GitHub Actions, without any extra third-party services. Just add a single uses: line to your workflows.

  • Watch any script. Want to automatically re-run your build and tests whenever you make a change? Type npm test --watch. Any script you've configured using Wireit can be watched by typing --watch after it.

  • Great for single packages and monorepos. Wireit has no opinion about how your packages are arranged. It works great with single packages, because you can link together scripts within the same package. It also works great with any kind of monorepo, because you can link together scripts across different packages using relative paths.

  • Complements npm workspaces. We think Wireit could be the missing tool that unlocks the potential for npm workspaces to become the best way to set up monorepos. To use Wireit with npm workspaces, you'll just use standard npm workspace commands like npm run build -ws.

  • Adopt incrementally. Wireit scripts can depend on plain npm scripts, so they can be freely mixed. This means you can use Wireit only for the parts of your build that need it most, or you can try it out on a script-by-script basis without changing too much at the same time.

Contributing

See CONTRIBUTING.md

More Repositories

1

material-design-icons

Material Design icons by Google
49,605
star
2

guava

Google core libraries for Java
Java
48,313
star
3

zx

A tool for writing better scripts
JavaScript
37,928
star
4

styleguide

Style guides for Google-originated open-source projects
HTML
36,487
star
5

leveldb

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
C++
33,564
star
6

material-design-lite

Material Design Components in HTML/CSS/JS
HTML
32,283
star
7

googletest

GoogleTest - Google Testing and Mocking Framework
C++
32,215
star
8

jax

Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more
Python
27,869
star
9

python-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Python
26,112
star
10

comprehensive-rust

This is the Rust course used by the Android team at Google. It provides you the material to quickly teach Rust.
Rust
25,973
star
11

mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
C++
25,320
star
12

gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Java
22,856
star
13

flatbuffers

FlatBuffers: Memory Efficient Serialization Library
C++
21,883
star
14

iosched

The Google I/O Android App
Kotlin
21,792
star
15

ExoPlayer

An extensible media player for Android
Java
21,465
star
16

eng-practices

Google's Engineering Practices documentation
19,741
star
17

web-starter-kit

Web Starter Kit - a workflow for multi-device websites
HTML
18,434
star
18

flexbox-layout

Flexbox for Android
Kotlin
18,141
star
19

fonts

Font files available from Google Fonts, and a public issue tracker for all things Google Fonts
HTML
17,563
star
20

filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
C++
16,946
star
21

cadvisor

Analyzes resource usage and performance characteristics of running containers.
Go
16,273
star
22

libphonenumber

Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.
C++
15,728
star
23

gvisor

Application Kernel for Containers
Go
15,047
star
24

WebFundamentals

Former git repo for WebFundamentals on developers.google.com
JavaScript
13,842
star
25

yapf

A formatter for Python files
Python
13,560
star
26

tink

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
Java
13,318
star
27

deepdream

13,212
star
28

brotli

Brotli compression format
TypeScript
12,921
star
29

guetzli

Perceptual JPEG encoder
C++
12,863
star
30

guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.
Java
12,342
star
31

wire

Compile-time Dependency Injection for Go
Go
12,222
star
32

blockly

The web-based visual programming editor.
TypeScript
12,067
star
33

sanitizers

AddressSanitizer, ThreadSanitizer, MemorySanitizer
C
10,754
star
34

grumpy

Grumpy is a Python to Go source code transcompiler and runtime.
Go
10,464
star
35

or-tools

Google's Operations Research tools:
C++
10,405
star
36

dopamine

Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.
Jupyter Notebook
10,367
star
37

auto

A collection of source code generators for Java.
Java
10,234
star
38

go-github

Go library for accessing the GitHub v3 API
Go
9,941
star
39

oss-fuzz

OSS-Fuzz - continuous fuzzing for open source software.
Shell
9,859
star
40

go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.
Go
9,314
star
41

sentencepiece

Unsupervised text tokenizer for Neural Network-based text generation.
C++
8,657
star
42

re2

RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library.
C++
8,190
star
43

traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
JavaScript
8,182
star
44

tsunami-security-scanner

Tsunami is a general purpose network security scanner with an extensible plugin system for detecting high severity vulnerabilities with high confidence.
Java
8,086
star
45

trax

Trax — Deep Learning with Clear Code and Speed
Python
7,943
star
46

skia

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.
C++
7,874
star
47

benchmark

A microbenchmark support library
C++
7,812
star
48

android-classyshark

Android and Java bytecode viewer
Java
7,468
star
49

pprof

pprof is a tool for visualization and analysis of profiling data
Go
7,408
star
50

closure-compiler

A JavaScript checker and optimizer.
Java
7,245
star
51

agera

Reactive Programming for Android
Java
7,227
star
52

accompanist

A collection of extension libraries for Jetpack Compose
Kotlin
7,190
star
53

magika

Detect file content types with deep learning
Python
7,171
star
54

flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
C++
7,109
star
55

latexify_py

A library to generate LaTeX expression from Python code.
Python
6,953
star
56

diff-match-patch

Diff Match Patch is a high-performance library in multiple languages that manipulates plain text.
Python
6,918
star
57

lovefield

Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.
JavaScript
6,847
star
58

glog

C++ implementation of the Google logging module
C++
6,797
star
59

jsonnet

Jsonnet - The data templating language
Jsonnet
6,742
star
60

error-prone

Catch common Java mistakes as compile-time errors
Java
6,690
star
61

model-viewer

Easily display interactive 3D models on the web and in AR!
TypeScript
6,473
star
62

gops

A tool to list and diagnose Go processes currently running on your system
Go
6,375
star
63

draco

Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
C++
6,188
star
64

automl

Google Brain AutoML
Jupyter Notebook
6,150
star
65

gopacket

Provides packet processing capabilities for Go
Go
6,082
star
66

physical-web

The Physical Web: walk up and use anything
Java
6,017
star
67

j2objc

A Java to iOS Objective-C translation tool and runtime.
Java
5,976
star
68

grafika

Grafika test app
Java
5,964
star
69

snappy

A fast compressor/decompressor
C++
5,940
star
70

ios-webkit-debug-proxy

A DevTools proxy (Chrome Remote Debugging Protocol) for iOS devices (Safari Remote Web Inspector).
C
5,848
star
71

osv-scanner

Vulnerability scanner written in Go which uses the data provided by https://osv.dev
Go
5,821
star
72

seesaw

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.
Go
5,599
star
73

seq2seq

A general-purpose encoder-decoder framework for Tensorflow
Python
5,577
star
74

EarlGrey

🍵 iOS UI Automation Test Framework
Objective-C
5,570
star
75

flax

Flax is a neural network library for JAX that is designed for flexibility.
Python
5,493
star
76

google-java-format

Reformats Java source code to comply with Google Java Style.
Java
5,366
star
77

battery-historian

Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.
Go
5,249
star
78

clusterfuzz

Scalable fuzzing infrastructure.
Python
5,201
star
79

bbr

5,156
star
80

gumbo-parser

An HTML5 parsing library in pure C99
HTML
5,141
star
81

syzkaller

syzkaller is an unsupervised coverage-guided kernel fuzzer
Go
5,111
star
82

git-appraise

Distributed code review system for Git repos
Go
5,090
star
83

google-authenticator

Open source version of Google Authenticator (except the Android app)
Java
5,077
star
84

gemma.cpp

lightweight, standalone C++ inference engine for Google's Gemma models.
C++
5,076
star
85

uuid

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
Go
4,994
star
86

gemma_pytorch

The official PyTorch implementation of Google's Gemma models
Python
4,920
star
87

gts

☂️ TypeScript style guide, formatter, and linter.
TypeScript
4,890
star
88

closure-library

Google's common JavaScript library
JavaScript
4,837
star
89

cameraview

[DEPRECATED] Easily integrate Camera features into your Android app
Java
4,734
star
90

grr

GRR Rapid Response: remote live forensics for incident response
Python
4,641
star
91

liquidfun

2D physics engine for games
C++
4,559
star
92

pytype

A static type analyzer for Python code
Python
4,528
star
93

gxui

An experimental Go cross platform UI library.
Go
4,450
star
94

bloaty

Bloaty: a size profiler for binaries
C++
4,386
star
95

clasp

🔗 Command Line Apps Script Projects
TypeScript
4,336
star
96

ko

Build and deploy Go applications on Kubernetes
Go
4,329
star
97

santa

A binary authorization and monitoring system for macOS
Objective-C
4,288
star
98

google-ctf

Google CTF
Go
4,246
star
99

tamperchrome

Tamper Dev is an extension that allows you to intercept and edit HTTP/HTTPS requests and responses as they happen without the need of a proxy. Works across all operating systems (including Chrome OS).
TypeScript
4,148
star
100

end-to-end

End-To-End is a crypto library to encrypt, decrypt, digital sign, and verify signed messages (implementing OpenPGP)
JavaScript
4,126
star