{"library":"prepr","title":"prepr","description":"String preprocessor implementing C/GLSL preprocessor-style directives (#define, #if, #ifdef, #elif, #else, #endif) for JavaScript environments. Version 2.0+ uses ESM and uses 'subscript' for expression evaluation. Designed for glsl-transpiler, it supports variable interpolation and macro functions. Lightweight, no external dependencies. Ideal for preprocessing GLSL shader code or any string that benefits from compile-time conditionals.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install prepr"],"cli":null},"imports":["import prepr from 'prepr';","import prepr from 'prepr';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import prepr from 'prepr';\n\nconst input = `\n  #define A 2\n  #ifdef A\n    var a = A;\n  #endif\n  var b = myVar;\n`;\n\nconst result = prepr(input, {\n  myVar: 1\n});\n\nconsole.log(result);\n// Output:\n//\n//   var a = 2;\n//   var b = 1;\n//","lang":"typescript","description":"Demonstrates basic usage of prepr with #define, #ifdef, and variable interpolation.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}