# glslify-lite

> A fast, lightweight fork of glslify

Latest version **0.0.7** (published 2019-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install glslify-lite
pnpm add glslify-lite
yarn add glslify-lite
bun add glslify-lite
```

Provides the command `glslify-lite`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-07-15 |
| First published | 2019-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 355 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fand |
| Maintainers | fand |

## Links

- npm: https://www.npmjs.com/package/glslify-lite
- Repository: https://github.com/fand/glslify-lite
- Issues: https://github.com/fand/glslify-lite/issues
- npm.io page: https://npm.io/package/glslify-lite

## Dependencies (18)

- [meow](https://npm.io/package/meow.md) ^5.0.0
- [pify](https://npm.io/package/pify.md) ^4.0.1
- [get-stdin](https://npm.io/package/get-stdin.md) ^7.0.0
- [source-map](https://npm.io/package/source-map.md) ^0.8.0-beta.0
- [npm-run-all](https://npm.io/package/npm-run-all.md) ^4.1.5
- [stack-trace](https://npm.io/package/stack-trace.md) 0.0.10
- [glslify-deps](https://npm.io/package/glslify-deps.md) ^1.3.1
- [shallow-copy](https://npm.io/package/shallow-copy.md) 0.0.1
- [murmurhash-js](https://npm.io/package/murmurhash-js.md) ^1.0.0
- [glsl-tokenizer](https://npm.io/package/glsl-tokenizer.md) ^2.1.5
- [glsl-token-depth](https://npm.io/package/glsl-token-depth.md) ^1.1.2
- [glsl-token-scope](https://npm.io/package/glsl-token-scope.md) ^1.1.2
- [glsl-token-string](https://npm.io/package/glsl-token-string.md) ^1.0.1
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^1.6.0
- [glsl-token-defines](https://npm.io/package/glsl-token-defines.md) ^1.0.0
- [glsl-token-descope](https://npm.io/package/glsl-token-descope.md) ^1.0.2
- [glsl-inject-defines](https://npm.io/package/glsl-inject-defines.md) ^1.0.3
- [glsl-token-whitespace-trim](https://npm.io/package/glsl-token-whitespace-trim.md) ^1.0.0

## Recent versions

- 0.0.7 (latest) — 2019-07-15
- 0.0.6 — 2019-07-15
- 0.0.5 — 2019-07-12
- 0.0.4 — 2019-07-12
- 0.0.3 — 2019-06-27
- 0.0.2 — 2019-06-27
- 0.0.1 — 2019-05-27

## README

# glslify-lite

[![](https://img.shields.io/travis/fand/glslify-lite.svg)](https://travis-ci.org/fand/glslify-lite) [![](https://img.shields.io/codecov/c/github/fand/glslify-lite.svg)](https://codecov.io/gh/fand/glslify-lite) ![](https://img.shields.io/npm/l/glslify-lite.svg)

A fast, lightweight fork of [glslify](https://github.com/glslify/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<string>

Compile a shader string from a string `src`.

Optionally provide:

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

#### glslify.file(filename, opts): Promise<string>

Compile a shader from a `filename`.

Optionally provide:

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

## LICENSE

MIT

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