{"versions":{"1.0.0":{"name":"glsl-token-whitespace-trim","version":"1.0.0","description":"Trim the whitespace within an array of GLSL tokens","main":"index.js","license":"MIT","author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"https://github.com/hughsk"},"dependencies":{},"devDependencies":{"gl":"^2.1.5","gl-shader":"^4.0.6","glsl-token-string":"^1.0.1","glsl-tokenizer":"^2.0.2","standard":"^5.4.1","tap-spec":"^4.1.1","tape":"^4.2.2"},"scripts":{"test":"standard && node test.js | tspec"},"keywords":["glsl","token","tokenizer","glslify","ecosystem:stackgl","whitespace","trim"],"repository":{"type":"git","url":"git://github.com/hughsk/glsl-token-whitespace-trim.git"},"homepage":"https://github.com/hughsk/glsl-token-whitespace-trim","bugs":{"url":"https://github.com/hughsk/glsl-token-whitespace-trim/issues"},"gitHead":"46d2e1fc26b904d126568421c61001c8697369d2","_id":"glsl-token-whitespace-trim@1.0.0","_shasum":"46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"anonymous","email":"hughskennedy@gmail.com"},"dist":{"shasum":"46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10","size":2833,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz","integrity":"sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ=="},"maintainers":[{"name":"anonymous","email":"arch.mojtaba.samimi@gmail.com"},{"name":"anonymous","email":"post.ben.here@gmail.com"},{"name":"anonymous","email":"df.creative@gmail.com"},{"name":"anonymous","email":"arnebackeric@gmail.com"},{"name":"anonymous","email":"renaudeau.gaetan@gmail.com"},{"name":"anonymous","email":"hughskennedy@gmail.com"},{"name":"anonymous","email":"dave.des@gmail.com"},{"name":"anonymous","email":"me@mikkoh.com"},{"name":"anonymous","email":"mikolalysenko@gmail.com"},{"name":"anonymous","email":"syed.reza.ali@gmail.com"},{"name":"anonymous","email":"rsreusser@gmail.com"},{"name":"anonymous","email":"tatum.creative@gmail.com"},{"name":"anonymous","email":"thibaut.seguy@gmail.com"},{"name":"anonymous","email":"marcin.ignac@gmail.com"},{"name":"anonymous","email":"wwwtyro@gmail.com"},{"name":"anonymous","email":"i@yoshuawuyts.com"}],"directories":{},"publish_time":1448365516025,"_hasShrinkwrap":false,"_cnpm_publish_time":1448365516025,"_cnpmcore_publish_time":"2021-12-16T21:38:26.367Z","contributors":[]}},"dist-tags":{"latest":"1.0.0"},"name":"glsl-token-whitespace-trim","time":{"created":"2022-01-27T08:10:38.161Z","modified":"2025-12-07T02:16:54.166Z","1.0.0":"2015-11-24T11:45:16.025Z"},"readme":"# glsl-token-whitespace-trim\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nTrim the whitespace within an array of GLSL tokens provided by [glsl-tokenizer](https://github.com/stackgl/glsl-tokenizer). Useful for minimising shader source size, especially after heavy processing steps such as seen in [glslify](http://github.com/stackgl/glslify) or as part of a GLSL minifier.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-token-whitespace-trim.png)](https://www.npmjs.com/package/glsl-token-whitespace-trim)\n\n### `trim(tokens, [all])`\n\nTrims the whitespace in an array of GLSL `tokens`. By default, this will trim repeated to newlines such that no more than two newlines will appear in a row.\n\nIf you're more concerned about size than aesthetics, you can pass `true` as the second argument to remove *all* extraneous whitespace (more or less).\n\n``` javascript\nconst tokenize = require('glsl-tokenizer')\nconst string = require('glsl-token-string')\nconst trim = require('glsl-token-whitespace-trim')\nconst fs = require('fs')\n\nconst src = fs.readFileSync('shader.glsl', 'utf8')\nconst tokens = tokenize(src)\n\ntrim(tokens, true)\n\nconst trimmed = string(tokens)\n```\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/hughsk/glsl-token-whitespace-trim/blob/master/LICENSE.md) for details.","users":{}}