# glsl-deparser

> through stream that translates glsl-parser AST nodes into working glsl code

Latest version **1.0.0** (published 2014-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install glsl-deparser
pnpm add glsl-deparser
yarn add glsl-deparser
bun add glsl-deparser
```

## 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 | 2014-07-05 |
| First published | 2012-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | chrisdickinson |
| Keywords | glsl, deparser, stream |

## Links

- npm: https://www.npmjs.com/package/glsl-deparser
- Repository: https://github.com/gl-modules/glsl-deparser
- Issues: https://github.com/gl-modules/glsl-deparser/issues
- npm.io page: https://npm.io/package/glsl-deparser

## Dependencies (2)

- [through](https://npm.io/package/through.md) ~1.1.2
- [cssauron-glsl](https://npm.io/package/cssauron-glsl.md) X.X.X

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-07-05
- 0.0.3 — 2014-04-24
- 0.0.2 — 2012-11-25
- 0.0.1 — 2012-11-24
- 0.0.0 — 2012-11-24

## README

# glsl-deparser

```javascript

var Path = require('path')

var tokenizer = require('glsl-tokenizer')()
  , parser = require('glsl-parser')
  , deparser = require('glsl-deparser')

process.stdin
  .pipe(tokenizer)
  .pipe(parser())
  .pipe(deparser())             // <-- deparser!
  .pipe(process.stdout)

process.stdin.resume()

```

transform a stream of [glsl-parser](https://github.com/chrisdickinson/glsl-parser) AST nodes
into strings.

only operates on top-level statements emitted by `glsl-parser`, so the code it emits is executable
by webgl.

# api

### deparser(whitespace_enabled=true, tab_text='  ')

Creates a `readable`/`writable` stream.

If no args are provided, `whitespace` is assumed to be enabled, and the tab text will be `'  '`.

If you pass `false` for the first arg, only syntactically significant whitespace will be emitted (it'll behave like a poor man's minifier).

If you pass `true` and tab text, that tab text will be used to indent code.

# note

the big caveat is that preprocessor if statements (`#if*`, `#endif`) won't work unless
each branch produces a parseable tree.

# license

MIT

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