Skip to content

Commit 4a64894

Browse files
committed
readme
1 parent a9159fd commit 4a64894

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

d2js/README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
`GOOS=js GOARCH=wasm go build -ldflags='-s -w' -trimpath -o main.wasm ./d2js`
1+
# D2 as a Javascript library
2+
3+
D2 is runnable as a Javascript library, on both the client and server side. This means you
4+
can run D2 entirely on the browser.
5+
6+
This is achieved by a JS wrapper around a WASM file.
7+
8+
## Install
9+
10+
### NPM
11+
12+
```sh
13+
npm install @terrastruct/d2
14+
```
15+
16+
### Yarn
17+
18+
```sh
19+
yarn add @terrastruct/d2
20+
```
21+
22+
## Build
23+
24+
```sh
25+
GOOS=js GOARCH=wasm go build -ldflags='-s -w' -trimpath -o main.wasm ./d2js
26+
```
27+
28+
## API
29+
30+
todo

0 commit comments

Comments
 (0)