grunt-glitch
Version:
A grunt task you shouldn’t use.
42 lines (41 loc) • 3.61 kB
JSON
{
"name": "grunt-glitch",
"description": "A grunt task you shouldn’t use.",
"version": "0.2.0",
"homepage": "https://github.com/kchapelier/grunt-glitch",
"author": {
"name": "Kevin Chapelier"
},
"repository": {
"type": "git",
"url": "git://github.com/kchapelier/grunt-glitch.git"
},
"bugs": {
"url": "https://github.com/kchapelier/grunt-glitch/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/kchapelier/grunt-glitch/blob/master/LICENSE"
}
],
"engines": {
"node": ">= 0.10.0"
},
"dependencies": {
"glitch": "~0.1.0",
"memorystream": "~0.2.0"
},
"peerDependencies": {
"grunt": "~0.4.0"
},
"keywords": [
"gruntplugin",
"glitch",
"corruption"
],
"readme": "# grunt-glitch\n\n> A grunt task you shouldn't use.\n\nThis grunt task is used to intentionally corrupt and mangle files. Use with caution.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.2`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-glitch --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-glitch');\n```\n\n## The \"glitch\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `glitch` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n glitch: {\n options: {\n // Task-specific options go here.\n },\n your_target: {\n // Target-specific file lists and/or options go here.\n },\n },\n});\n```\n\n### Options\n\n#### options.enabled\nType: `Boolean`\nDefault value: false\n\nMust be explicitly set to true to activate the task. Make sure you fully understand what this grunt plugin does before testing it.\n\n#### options.force\nType: `Boolean`\nDefault value: false\n\nSet to true to ignore errors.\n\n#### options.probability\nType: `String`\nDefault value: `0.0001`\n\nProbability of deviation per byte (between 0 and 1).\n\n#### options.deviation\nType: `Number`\nDefault value: `2`\n\nMaximum value deviation per byte.\n\n#### options.whiteList\nType: `Number[]`\nDefault value: `[]`\n\nArray of whitelisted values, if set only bytes with those values will be modified.\n\n#### options.blackList\nType: `Number[]`\nDefault value: `[]`\n\nArray of blacklisted values, no byte with those values will be modified.\n\n#### options.deviationFunction\nType: `Function`\nDefault value: `null`\n\nReplace the default deviation function of the stream, allows to write more complex filtering than whitelisting and blacklisting.\n\n### Usage Examples\n\nIn this example, we slightly corrupt every jpg files to get glitched images.\n\n```js\ngrunt.initConfig({\n glitch: {\n options: {\n enabled : true,\n force : true\n },\n my_targets : {\n src: ['**/*.jpg'],\n deviation : 2,\n probability : 0.0001,\n }\n }\n});\n```\n\n## Potential use cases\n\n* Glitch a set of image files without any actual code except for a friendly grunt task.\n* Train your debug muscles.\n* Celebrating april's fool day at the expense of a grunt user.\n\n## License\n\nMIT\n",
"readmeFilename": "README.md",
"_id": "grunt-glitch@0.1.0",
"_from": "grunt-glitch@~0.1.0"
}