Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glsl-deparser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-deparser

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

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
increased by10.37%
Maintainers
1
Weekly downloads
 
Created
Source

glsl-deparser


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 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

Keywords

FAQs

Package last updated on 05 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc