@wasm-fmt/gofmt 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/gofmt_vite.js +0 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -32,12 +32,6 @@ const formatted = format(source);
|
|
|
32
32
|
console.log(formatted);
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
## Node.js < 22.19
|
|
36
|
-
|
|
37
|
-
```JavaScript
|
|
38
|
-
import { format } from "@wasm-fmt/gofmt/node";
|
|
39
|
-
```
|
|
40
|
-
|
|
41
35
|
## Web
|
|
42
36
|
|
|
43
37
|
For web environments, you need to initialize WASM module manually:
|
|
@@ -67,6 +61,12 @@ await init();
|
|
|
67
61
|
// ...
|
|
68
62
|
```
|
|
69
63
|
|
|
64
|
+
Or use the `./bundler` entry with [vite-plugin-wasm](https://www.npmjs.com/package/vite-plugin-wasm)
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
import { format } from "@wasm-fmt/gofmt/bundler";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
70
|
## Entry Points
|
|
71
71
|
|
|
72
72
|
- `.` - Auto-detects environment (Node.js uses node, Webpack uses bundler, default is ESM)
|
package/gofmt_vite.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wasm-fmt/gofmt",
|
|
3
3
|
"description": "A wasm based golang formatter",
|
|
4
4
|
"author": "magic-akari <akari.ccino@gamil.com>",
|
|
5
|
-
"version": "0.7.
|
|
5
|
+
"version": "0.7.3",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"wasm",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"types": "./gofmt.d.ts",
|
|
24
24
|
"webpack": "./gofmt.js",
|
|
25
25
|
"deno": "./gofmt.js",
|
|
26
|
+
"bun": "./gofmt_node.js",
|
|
26
27
|
"module-sync": "./gofmt_node.js",
|
|
28
|
+
"node": "./gofmt_node.js",
|
|
27
29
|
"default": "./gofmt_esm.js"
|
|
28
30
|
},
|
|
29
31
|
"./esm": {
|