{"id":26375628,"url":"https://github.com/stevenbenner/grunt-indent","last_synced_at":"2025-07-01T11:06:52.053Z","repository":{"id":7472915,"uuid":"8820891","full_name":"stevenbenner/grunt-indent","owner":"stevenbenner","description":" :bookmark_tabs: A Grunt task to change the indentation of files.","archived":false,"fork":false,"pushed_at":"2017-04-23T00:16:10.000Z","size":41,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T14:46:42.646Z","etag":null,"topics":["grunt","grunt-plugins","grunt-task","indentation","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hundt/github-go","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevenbenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-16T15:40:59.000Z","updated_at":"2024-08-28T18:45:36.000Z","dependencies_parsed_at":"2022-07-09T15:47:16.170Z","dependency_job_id":null,"html_url":"https://github.com/stevenbenner/grunt-indent","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenbenner%2Fgrunt-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenbenner%2Fgrunt-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenbenner%2Fgrunt-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenbenner%2Fgrunt-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenbenner","download_url":"https://codeload.github.com/stevenbenner/grunt-indent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960618,"owners_count":20375106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grunt","grunt-plugins","grunt-task","indentation","javascript","nodejs"],"created_at":"2025-03-17T02:18:05.292Z","updated_at":"2025-03-17T02:18:05.805Z","avatar_url":"https://github.com/stevenbenner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-indent\n\nA grunt task to change the indentation of files.\n\n[![Build Status](https://travis-ci.org/stevenbenner/grunt-indent.svg?branch=master)](https://travis-ci.org/stevenbenner/grunt-indent) [![Dependency Status](https://gemnasium.com/stevenbenner/grunt-indent.svg)](https://gemnasium.com/stevenbenner/grunt-indent) [![npm](https://img.shields.io/npm/v/grunt-indent.svg)](https://www.npmjs.com/package/grunt-indent)\n\n## Getting Started\nThis plugin requires Grunt `\u003e=0.4.0`\n\nIf you haven't used [Grunt](https://gruntjs.com/) before, be sure to check out the [Getting Started](https://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](https://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-indent --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-indent');\n```\n\n## The \"indent\" task\n\n### Overview\nThis task will let you increase or decrease the indentation of lines within files. It simply walks all of the lines in the specified files, adds or removes indents as you specify in the options, and saves the modified files to the location you want.\n\nThis is useful for building JavaScript projects where you want the built/concatenated files to have proper indentation.\n\n### Options\n\n#### options.style\nType: `String`\nDefault value: `tab`\n\nThe type of indentation to add or remove. The options are `tab` or `space`.\n\n#### options.size\nType: `Number`\nDefault value: `1`\n\nThe number of `options.style` characters in an indent. For example, if you use 2 spaces per indent then you would set `options.style` to `space`, and this to `2`.\n\n#### options.change\nType: `Number`\nDefault value: `0`\n\nThe indentation level change. If this is a positive number it will indent all lines the specified number of times. If this is a negative number it will remove the specified number of indents. If this number is zero then it will merely copy the files without modifying the contents.\n\n### Usage Examples\n\n#### Increase Indentation\nIn this example the indent task will increase the indent of all .js files in the src directory by one and save the modified files in the dist directory.\n\n```js\ngrunt.initConfig({\n  indent: {\n    scripts: {\n      src: [\n        'src/*.js'\n      ],\n      dest: 'dist/',\n      options: {\n        style: 'space',\n        size: 2,\n        change: 1\n      }\n    }\n  }\n});\n```\n\n#### Decrease Indentation\nIn this example the indent task will decrease the indent of all .css files in the css directory by one and save the modified files in the dist directory.\n\n```js\ngrunt.initConfig({\n  indent: {\n    stylesheets: {\n      src: [\n        'css/*.css'\n      ],\n      dest: 'dist/',\n      options: {\n        style: 'space',\n        size: 2,\n        change: -1\n      }\n    }\n  }\n});\n```\n\n## Release History\n * 2017-04-22   v1.0.0   Increase min Node.js version to 0.10. Corrected \"main\" target.\n * 2016-02-28   v0.1.5   Updated grunt peer dependency to support Grunt v1.0.\n * 2013-11-08   v0.1.4   Added success message to grunt output.\n * 2013-03-23   v0.1.3   Files will now be saved with Grunt defined line endings.\n * 2013-03-21   v0.1.2   Fixed bug with empty lines when file uses Windows style line endings.\n * 2013-03-17   v0.1.1   Added support for single-file destinations.\n * 2013-03-16   v0.1.0   Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenbenner%2Fgrunt-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenbenner%2Fgrunt-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenbenner%2Fgrunt-indent/lists"}