# node-dawn

> WebGPU for node. Combines official dawn/node headless bindings with a glfw window/surface for rendering

Latest version **1.0.0** (published 2022-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-dawn
pnpm add node-dawn
yarn add node-dawn
bun add node-dawn
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-09-19 |
| First published | 2022-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 2 |
| Author | Matt Gattis |
| Maintainers | gattis |

## Links

- npm: https://www.npmjs.com/package/node-dawn
- Repository: https://github.com/gattis/node-dawn
- Issues: https://github.com/gattis/node-dawn/issues
- npm.io page: https://npm.io/package/node-dawn

## Recent versions

- 1.0.0 (latest) — 2022-09-19

## README

# node-dawn
WebGPU for node. Combines official dawn/node headless bindings with a glfw window/surface for rendering
## install
```
npm install node-dawn
```
## use
```
const { GPU } = require('node-dawn')
let gpu = new GPU(["dawn-backend=vulkan","disable-dawn-features=disallow_unsafe_apis"])
let ctx = gpu.createWindow(1500, 1500, "window title", (glfwInputEventName, ...glfwInputEventArgs) => {
    // process window event callbacks here
    if (glfwInputEventName == 'quit') ctx.close()
})
let adapter = await gpu.requestAdapter()
let device = await adapter.requestDevice()
ctx.configure({ device })
```
At that point you can go on using `gpu` like you got it from `navigator.gpu` and `ctx` like you got it from `canvas.getContext('webgpu')`

Now you can run your webgpu javascript natively and quit jumping through browser developer hoops until it's more stable.

I've found that this is a bit faster than using it through chrome, and that on windows, using the vulkan backend gives me about 1.5x the fps as the d3d12 backend.  Mileage may vary of course.

---
_Source: https://npm.io/package/node-dawn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
