Skip to content
A fast, lightweight fork of glslify
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
src
test
typings
.eslintrc
.gitignore
.prettierrc.js
.travis.yml
README.md
package.json
renovate.json
tsconfig.json

README.md

glslify-lite

A fast, lightweight fork of glslify. Intended to provide more useful APIs for linters, live coding apps, etc.

Why?

glslify is great, but has some problems especially in realtime usage such as linters, live coding, etc.

  • Synchronous, blocking API by design
  • No support for sourcemaps

glslify-lite overcomes these problems. However, we don't provide completely same features as glslify.

glslify glslify-lite
API Sync Async
Sourcemaps -
Output code is clean -
Transformer support Only built-in
Tagged template literal -
Browserify -

Install

npm i glslify-lite

Usage

CLI

The CLI can take a file as its first argument, and output to a file using the -o flag:

glslify-lite index.glsl -o output.glsl

It can also read input from stdin and output to stdout:

cat index.glsl | glslify-lite > output.glsl

API

glslify.compile(src, opts): Promise

Compile a shader string from a string src.

Optionally provide:

  • opts.basedir - directory to resolve relative paths in src

glslify.file(filename, opts): Promise

Compile a shader from a filename.

Optionally provide:

  • opts.basedir - directory to resolve relative paths in src

LICENSE

MIT

You can’t perform that action at this time.