Registry / devops / shader-minifier

shader-minifier

JSON →
library0.0.1jsnpmunverified

A Node.js wrapper for Shader_Minifier, a tool that minifies GLSL shader code using an external Mono runtime. Current version 0.0.1. Relies on Mono to execute the original C# minifier; no native Node implementation. Limited to environments with Mono installed. Not actively maintained; provide your own Mono binary.

npm install shader-minifier
INSTALL
IMPORT
SIG · SHADER-MINIFIER
S
shader-minifier
devopsjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

minify
import { minify } from 'shader-minifier'
import minify from 'shader-minifier'
Named export only; no default export.
ShaderMinifier
import { ShaderMinifier } from 'shader-minifier'
const ShaderMinifier = require('shader-minifier').default
Also a class export; note ESM-only.
ShaderMinifierOptions
import type { ShaderMinifierOptions } from 'shader-minifier'
TypeScript type export for options.

Shows basic usage of the minify function with a simple fragment shader.

import { minify } from 'shader-minifier'; const shader = ` void main() { gl_FragColor = vec4(1.0); } `; minify(shader, { preserveExternals: false }) .then(result => console.log(result)) .catch(err => console.error(err));
Debug
Known issues
breakingMono runtime required — package will fail if mono is not installed or not in PATH.
fix
Install Mono (https://www.mono-project.com/) and ensure it's available globally.
affects: all
gotchaUnix line endings expected; Windows may need adaptation.
fix
Use Unix-compatible shell or configure Mono accordingly.
affects: all
gotchaNo Node-native minification — all work done by external Mono process.
fix
Consider alternative pure JS minifiers if Mono is not available.
affects: all
Errors
Common errors & fixes
Error: spawn mono ENOENT
Mono is not installed or not in PATH.
fix
Install Mono from https://www.mono-project.com/download/ and restart terminal.
TypeError: (intermediate value) is not iterable
Result parsing failure due to unexpected Mono output.
fix
Check shader syntax; ensure Mono version compatible.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
shader-minifier — npm install shader-minifier · libregistry