{"name":"gl-format-compiler-error","version":"1.0.3","description":"Formats a webgl glsl compiler error.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/wwwtyro/gl-format-compiler-error.git"},"keywords":["stackgl","webgl","glsl"],"author":{"name":"Rye Terrell","email":"ryeterrell@ryeterrell.net","url":"http://wwwtyro.github.io"},"license":"Unlicense","bugs":{"url":"https://github.com/wwwtyro/gl-format-compiler-error/issues"},"homepage":"https://github.com/wwwtyro/gl-format-compiler-error#readme","dependencies":{"add-line-numbers":"^1.0.1","gl-constants":"^1.0.0","glsl-shader-name":"^1.0.0","sprintf-js":"^1.0.3"},"gitHead":"c78335f7d87a06e4c1d5ddc97817431b725d12cf","_id":"gl-format-compiler-error@1.0.3","_shasum":"0c79b1751899ce9732e86240f090aa41e98471a8","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"wwwtyro","email":"wwwtyro@gmail.com"},"dist":{"shasum":"0c79b1751899ce9732e86240f090aa41e98471a8","tarball":"http://registry-npm.ywwl.com/gl-format-compiler-error/download/gl-format-compiler-error-1.0.3.tgz","integrity":"sha512-FtQaBYlsM/rnz7YhLkxG9dLcNDB+ExErIsFV2DXl0nk+YgIZ2i0jMob4BrhT9dNa179zFb0gZMWpNAokytK+Ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZnURnxRLJdrJUHLCsAhxdhdbutdq35YtwUjIcDnFp9wIgStTDP8/Jt1b/CeWuphlrHD0+lINh/Rm1Zry6aU5PtLw="}],"size":2867,"noattachment":false,"key":"/gl-format-compiler-error/-/gl-format-compiler-error-1.0.3.tgz"},"maintainers":[{"name":"wwwtyro","email":"wwwtyro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gl-format-compiler-error-1.0.3.tgz_1504614539820_0.3210633888375014"},"directories":{},"readme":"# gl-format-compiler-error\n\nFormats a webgl glsl compiler error. Use in conjunction with\n[glsl-shader-name](https://www.npmjs.com/package/glsl-shader-name) to include your shader's \nname in the formatted error string.\n\n## Example\n\n```js\n    var formatCompilerError = require('gl-format-compiler-error');\n    \n    ...\n    \n    var shader = gl.createShader(type)\n    gl.shaderSource(shader, src)\n    gl.compileShader(shader)\n    if(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n        var errLog = gl.getShaderInfoLog(shader)\n        var fmt = formatCompilerError(errLog, src, type);\n        console.warn(fmt.long);\n        throw new Error(fmt.short);\n    }\n```\n\nyields warning:\n\n```text\nError in vertex shader generic:\n  13: \n  14: void main() {\n  15:     bug;\n^^^^: 'bug' : undeclared identifier\n\n  17:     vUV = aUV;\n  18:     vPos = vec3(uModel * vec4(aPosition, 1.0))\n  19: }\n^^^^: '}' : syntax error\n```\n\nand error:\n\n```text\nUncaught Error: Error in vertex shader generic:\nERROR: 0:15: 'bug' : undeclared identifier \nERROR: 0:19: '}' : syntax error \n```\n\n## Usage\n\n### Install\n\n```sh\nnpm install gl-format-compiler-error --save\n```\n\n### API\n\n```js\nvar formatCompilerError = require('gl-format-compiler-error');\n```\n\n#### `fmt = formatCompilerError(errLog, source, type)`\n\nTakes `errLog` result from `gl.getShaderInfoLog`, the shader `source` string, and the `type` of shader,\neither `gl.VERTEX_SHADER` or `gl.FRAGMENT_SHADER`. Returns an object that contains the long and short\nform of the formatted error:\n\n```js\n{\n    long: \"long form error with code snippets\",\n    short: \"short form error, similar to the original error log\"\n}\n```","publish_time":1504614540733,"_cnpm_publish_time":1504614540733,"dist-tags":{"latest":"1.0.3"}}