Skip to content
PluginStats

go-prettier-format weekly downloads statistics

By gitdog01 · npm · Prettier plugins

Prettier plugin for Go, powered by WASM.

View on npm Outdated · Nov 29, 2026

go-prettier-format has 8 recorded weekly downloads on npm, an increase of 100% over the past 30 days, ranking #3173 of 3,247 tracked listings.

Weekly downloads
8
Official API · Dec 5, 2026
7-day growth
+167%
+5 weekly downloads
30-day growth
+100%
+4 weekly downloads
90-day growth
+300%
+6 weekly downloads
Rank
#3173
▼ 25 in 7 days

About go-prettier-format

Prettier Plugin for Go (using WASM)

npm version License: MIT

This is a Prettier v3 plugin for the Go programming language. It formats Go code using the official go/format package, which is compiled to WebAssembly (WASM) to run in a Node.js environment.

Background

As web developers, we love the consistent code style that Prettier brings to our projects. However, when working on projects that involve Go - for instance, a Go backend with a JavaScript frontend, or writing Go code in a web-based editor - the ability to format Go code with the same familiar tool was missing.

This project was born out of the desire to have a single, unified formatting toolchain. Instead of relying on external gofmt binaries, which can be brittle to manage in a Node.js-based development environment, this plugin leverages the power of WebAssembly. We compile Go's own formatting tools into a WASM module, allowing you to format Go code directly within your JavaScript-based tools, ensuring speed, portability, and consistency.

Installation

First, install Prettier (v3 or later) and this plugin from NPM:

npm install --save-dev prettier go-prettier-format

The plugin comes with a pre-compiled WASM module, so you don't need to have Go installed on your machine to use it.

Usage

Command Line

You can run Prettier from the command line to format your Go files:

# Format a specific file
npx prettier --write your-file.go

# Format all .go files in the project
npx prettier --write "**/*.go"

Note: For cross-platform compatibility in npm scripts, it's recommended to use single quotes: '**/*.go'.

package.json Script

For convenience, you can add a script to your package.json:

{
  "scripts": {
    "format": "prettier --write '**/*.go'"
  }
}
Editor Integration

Once installed, Prettier-compatible editors (like VS Code with the Prettier extension) should automatically pick up the plugin and use it to format .go files on save.

For Contributors

Interested in contributing? Here's how to get set up for development.

Development Setup
Option 1: Local Development (Requires Go + Node.js)

You will need to have Go (1.21+) and Node.js (18+) installed on your machine.

  1. Clone the repository and install dependencies:

    git clone https://github.com/gitdog01/go-prettier-format.git
    cd go-prettier-format
    npm install
    
  2. Build the WASM module:

    npm run build:wasm
    
Option 2: Docker Development (No Local Go/Node.js Required)

If you prefer not to install Go and Node.js locally, you can use Docker:

  1. Clone the repository:

    git clone https://github.com/gitdog01/go-prettier-format.git
    cd go-prettier-format
    
  2. Build using Docker:

    # Build the project
    docker build -t go-prettier-format .
    
    # Run tests
    docker run --rm go-prettier-format
    
    # Extract built artifacts (optional)
    docker run --rm -v $(pwd):/output go-prettier-format sh -c "cp go.wasm /output/ && cp -r dist /output/"
    
  3. Development with Docker Compose (recommended):

    # Build the project
    docker-compose run --rm build
    
    # Run tests
    docker-compose run --rm test
    
    # Development mode (build + test)
    docker-compose run --rm dev
    
Docker Quick Start

If you just want to try the plugin without installing Go or Node.js:

# Clone and test
git clone https://github.com/gitdog01/go-prettier-format.git
cd go-prettier-format
docker-compose run --rm test
Testing the Plugin

This repository comes with a set of test files to verify the plugin's functionality.

To run the tests:

npm test

This command will:

  • Build the latest version of the plugin from source.
  • Create a test_result directory.
  • Copy the sample files from the tests/ directory into it.
  • Run the Prettier formatter on the files inside test_result/.

You can then compare the original files in tests/ with the formatted files in test_result/ to see the plugin in action. For example, tests/messy.txt will be cleaned up, while tests/error.txt (which contains a syntax error) will remain untouched.

Note: The test files use a .txt extension to prevent editors from automatically formatting them. The test script tells Prettier to treat these .txt files as Go code.

Publishing to NPM

This package is configured to build automatically before publishing.

  1. Update the version number in package.json using npm version <patch|minor|major>.
  2. Run npm publish.

The prepublishOnly script will handle building the Wasm and JavaScript bundles before the package is uploaded to the registry.

How it Works

  1. The core formatting logic from Go's standard library (go/format) is compiled into a WebAssembly (.wasm) file.
  2. The wasm_exec.js script provided by Go is used to load and run the WASM module in Node.js.
  3. This Prettier plugin loads the WASM module and exposes the Go formatting function to Prettier's printing process.
  4. When Prettier processes a .go file, this plugin passes the code to the WASM module, which formats it and returns the result.

This approach ensures that the formatting is identical to what gofmt would produce, without needing a Go installation on the machine running the formatter.

Description from the npm listing.

  • prettier
  • prettier-plugin
  • go
  • golang
  • formatter

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

go-prettier-format weekly downloads on npm, last 90 days: 8 weekly downloads as of Dec 5, 2026, +300% over 90 days.go-prettier-formatWeekly downloads on npm · Last 90 days8downloads / week+300% over 90 days0246810Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
go-prettier-format weekly downloads on npm, last 90 days: 8 weekly downloads as of Dec 5, 2026, +300% over 90 days.

7/30/90-day growth

go-prettier-format weekly downloads growth on npm: +167% over 7 days, +100% over 30 days, +300% over 90 days.go-prettier-formatWeekly downloads growth on npm8downloads / week now7-day growth+5 weekly downloads+167%30-day growth+4 weekly downloads+100%90-day growth+6 weekly downloads+300%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
go-prettier-format weekly downloads growth on npm: +167% over 7 days, +100% over 30 days, +300% over 90 days.

Ranking history

go-prettier-format npm ranking history: currently #3173 (by weekly downloads).go-prettier-formatnpm ranking · by weekly downloads · Last 90 days#3173current rank#2000#2200#2400#2600#2800#3000#3200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 40 observations · Updated Dec 5, 2026pluginstats.com
go-prettier-format npm ranking history: currently #3173 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 159, #15 (overall #3,175)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 13, #2 (overall #242)
Prettier plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for go-prettier-format
Date (UTC)Weekly downloadsChange vs. previous
80
8-1
9+1
8+3
5+3
20
2-1
30
3-1
40
4+1
3-1
40
4—

Similar npm Prettier plugins plugins

All 20 go-prettier-format alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/go-prettier-format. First seen Oct 16, 2026; last successful collection Nov 29, 2026. See the methodology.