go-prettier-format weekly downloads statistics
By gitdog01 · npm · Prettier plugins
Prettier plugin for Go, powered by WASM.
go-prettier-format has 2 recorded weekly downloads on npm, a decrease of 71.4% over the past 30 days.
It ranks #2155 of 2,256 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by +100%.
PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.
About go-prettier-format
Prettier Plugin for Go (using WASM)
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:
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:
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:
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:
2. Build the WASM module:
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:
2. Build using Docker:
3. Development with Docker Compose (recommended):
Docker Quick Start
If you just want to try the plugin without installing Go or Node.js:
Testing the Plugin
This repository comes with a set of test files to verify the plugin's functionality.
To run the tests:
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 . 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
Where go-prettier-format sits in the listing
Each band is one page of 20. Weekly downloads on a log 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.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
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.
Recent observations
Full history (121)Similar npm Prettier plugins plugins
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 Oct 19, 2026. See the methodology.