{"name":"gl-format-compiler-error","version":"1.0.1","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":"8a54dbb7790f17eda16e67a4ff182382035bb582","_id":"gl-format-compiler-error@1.0.1","_shasum":"9eac415929c84135599298752e562867cf74227b","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"wwwtyro","email":"wwwtyro@gmail.com"},"dist":{"shasum":"9eac415929c84135599298752e562867cf74227b","tarball":"http://registry-npm.ywwl.com/gl-format-compiler-error/download/gl-format-compiler-error-1.0.1.tgz","integrity":"sha512-lSyffc5w7ByvP9vUv0Mg66Dntq9yKkInC8Hy9+7Tu49u8xfA/RDhcI/jbWd82Y6KQl7wYSdLW2ISzyxktXXKOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKyRDf9ZiS1C+ecrlBqO4749X1qcKUG8XTtsbYvX/4bAiEAsY5OUA4agPdlg6/YgXCumj9xYg3xBsCbBB+4TWH+YRs="}],"size":2873,"noattachment":false,"key":"/gl-format-compiler-error/-/gl-format-compiler-error-1.0.1.tgz"},"maintainers":[{"name":"wwwtyro","email":"wwwtyro@gmail.com"}],"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":1448385455705,"_cnpm_publish_time":1448385455705,"dist-tags":{"latest":"1.0.3"}}