Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Apr 8, 2023
1 parent 0e3e9af commit fcb6c6f
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion d2js/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
`GOOS=js GOARCH=wasm go build -ldflags='-s -w' -trimpath -o main.wasm ./d2js`
# D2 as a Javascript library

D2 is runnable as a Javascript library, on both the client and server side. This means you
can run D2 entirely on the browser.

This is achieved by a JS wrapper around a WASM file.

## Install

### NPM

```sh
npm install @terrastruct/d2
```

### Yarn

```sh
yarn add @terrastruct/d2
```

## Build

```sh
GOOS=js GOARCH=wasm go build -ldflags='-s -w' -trimpath -o main.wasm ./d2js
```

## API

todo

0 comments on commit fcb6c6f

Please sign in to comment.