{"_id":"glsl-token-whitespace-trim","_rev":"14-9874ebd33bdee734f3e351dbd11fafed","name":"glsl-token-whitespace-trim","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"glsl-token-whitespace-trim","version":"1.0.0","keywords":["glsl","token","tokenizer","glslify","ecosystem:stackgl","whitespace","trim"],"author":{"url":"https://github.com/hughsk","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-whitespace-trim@1.0.0","maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"homepage":"https://github.com/hughsk/glsl-token-whitespace-trim","bugs":{"url":"https://github.com/hughsk/glsl-token-whitespace-trim/issues"},"dist":{"shasum":"46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10","tarball":"https://registry.npmjs.org/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz","integrity":"sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==","signatures":[{"sig":"MEUCIQCudBuFetiZfKwTySeD6xC5fsHJvSC1GVCiVJmjUbkdHAIgeV3GuNPYzw8unIOzQhvHhjgSAw8+YiOg5vSLW2xxPFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10","gitHead":"46d2e1fc26b904d126568421c61001c8697369d2","scripts":{"test":"standard && node test.js | tspec"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/hughsk/glsl-token-whitespace-trim.git","type":"git"},"_npmVersion":"2.14.4","description":"Trim the whitespace within an array of GLSL tokens","directories":{},"_nodeVersion":"4.1.2","dependencies":{},"devDependencies":{"gl":"^2.1.5","tape":"^4.2.2","standard":"^5.4.1","tap-spec":"^4.1.1","gl-shader":"^4.0.6","glsl-tokenizer":"^2.0.2","glsl-token-string":"^1.0.1"}}},"time":{"created":"2015-11-24T11:45:16.025Z","modified":"2024-12-29T00:47:23.295Z","1.0.0":"2015-11-24T11:45:16.025Z"},"bugs":{"url":"https://github.com/hughsk/glsl-token-whitespace-trim/issues"},"author":{"url":"https://github.com/hughsk","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","homepage":"https://github.com/hughsk/glsl-token-whitespace-trim","keywords":["glsl","token","tokenizer","glslify","ecosystem:stackgl","whitespace","trim"],"repository":{"url":"git://github.com/hughsk/glsl-token-whitespace-trim.git","type":"git"},"description":"Trim the whitespace within an array of GLSL tokens","maintainers":[{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"mikolalysenko@gmail.com","name":"mikolalysenko"},{"email":"dave.des@gmail.com","name":"mattdesl"},{"email":"chris@neversaw.us","name":"chrisdickinson"},{"email":"javascript@yosh.is","name":"yoshuawuyts"},{"email":"me@mikkoh.com","name":"mikkoh"},{"email":"tatum.creative@gmail.com","name":"tatumcreative"},{"email":"wwwtyro@gmail.com","name":"wwwtyro"},{"email":"thibaut.seguy@gmail.com","name":"thibauts"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"df.creative@gmail.com","name":"dfcreative"},{"email":"arnebackeric@gmail.com","name":"erkaman"},{"email":"renaudeau.gaetan@gmail.com","name":"gre"},{"email":"rsreusser@gmail.com","name":"rreusser"},{"email":"marcin.ignac@gmail.com","name":"vorg"},{"email":"arch.mojtaba.samimi@gmail.com","name":"archmoj"}],"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.\n","readmeFilename":"README.md"}