# tinyest-for-wgsl

> Transforms JavaScript into its 'tinyest' form, to be used in generating equivalent (or close to) WGSL code.

Latest version **0.4.3** (published 2026-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install tinyest-for-wgsl
pnpm add tinyest-for-wgsl
yarn add tinyest-for-wgsl
bun add tinyest-for-wgsl
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2026-10-16 |
| First published | 2024-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12.20.0 |
| Dependencies | 1 |
| Unpacked size | 46.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3265 |
| Maintainers | iwoplaza, swm-bot |
| Keywords | compute, gpgpu, shader, shaders, tinyest, typegpu, typescript, webgpu, wgpu, wgsl |

## Links

- npm: https://www.npmjs.com/package/tinyest-for-wgsl
- Repository: https://github.com/software-mansion/TypeGPU
- Homepage: https://docs.swmansion.com/TypeGPU
- Issues: https://github.com/software-mansion/TypeGPU/issues
- npm.io page: https://npm.io/package/tinyest-for-wgsl

## Dependencies (1)

- [tinyest](https://npm.io/package/tinyest.md) ~0.3.4

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.4.3 (latest) — 2026-10-16
- 0.1.0-alpha.9 (alpha) — 2025-04-14
- 0.4.2 — 2026-09-25
- 0.4.1 — 2026-08-28
- 0.4.0 — 2026-08-12
- 0.3.3 — 2026-05-28
- 0.3.2 — 2026-03-11
- 0.3.1 — 2026-03-06
- 0.3.0 — 2026-02-24
- 0.2.0 — 2025-12-22
- 0.1.3 — 2025-10-29
- 0.1.2 — 2025-05-27
- 0.1.1 — 2025-05-14
- 0.1.0 — 2025-04-22
- 0.1.0-alpha.8 — 2025-04-04
- … 9 more at https://npm.io/package/tinyest-for-wgsl/versions

## README

# tinyest-for-wgsl

Transforms JavaScript into its 'tinyest' form, to be used in generating
equivalent (or close to) WGSL code. Used by
[**TypeGPU**](https://docs.swmansion.com/TypeGPU) to allow for shaders to be
written in JS.

## Basic principles

`tinyest-for-wgsl` is responsible for transforming JS function bodies of TypeGPU
declarations (e.g., `tgpu.fn`) into an embeddable syntax tree, gathering
external names outside of the scope of the function.

```ts
`(a, b) => {
  return a + b + double(a);
}`;
```

This can then be used to generate the following Embeddable Syntax Tree:

```js
// Can be injected with a simple JSON.stringify of a value that can be computed in the Rollup plugin.
{
  b: [{ r: { x: [{ x: ['a', '+', 'b'] }, '+', { f: ['double', ['a']] }] } }];
}
```

## tinyest is created by Software Mansion

[![swm](https://logo.swmansion.com/logo?color=white&variant=desktop&width=150&tag=typegpu-github 'Software Mansion')](https://swmansion.com)

Since 2012 [Software Mansion](https://swmansion.com) is a software agency with
experience in building web and mobile apps. We are Core React Native
Contributors and experts in dealing with all kinds of React Native issues. We
can help you build your next dream product –
[Hire us](https://swmansion.com/contact/projects?utm_source=tinyest&utm_medium=readme).

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