Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laurenhamel/grunt-xml-formatter
A Grunt wrapper for xml-formatter
https://github.com/laurenhamel/grunt-xml-formatter
Last synced: 6 days ago
JSON representation
A Grunt wrapper for xml-formatter
- Host: GitHub
- URL: https://github.com/laurenhamel/grunt-xml-formatter
- Owner: laurenhamel
- Created: 2019-09-19T17:51:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T23:40:20.000Z (over 2 years ago)
- Last Synced: 2024-11-07T14:53:06.216Z (12 days ago)
- Language: JavaScript
- Size: 1.58 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# grunt-xml-formatter
> A Grunt wrapper for [xml-formatter](https://www.npmjs.com/package/xml-formatter)
## Getting Started
If 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:
```
npm install grunt-xml-formatter xml-formatter --save-dev
```Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```
grunt.loadNpmTasks('grunt-xml-formatter');
```## Usage
Run this task with the `grunt xml-formatter` command.
## Examples
Add a section named `xml-formatter` to the data object passed into `grunt.initConfig()`, then pass in your files object or array.
**Beautify XML file(s)**
```js
grunt.initConfig({
'xml-formatter': {
target: {
options: {
indentation: ' ',
stripComments: true,
collapseContent: false,
debug: false
},
files: [{
expand: true,
cwd: 'src/',
src: ['**/*.xml']
dest: 'dest/'
}]
}
}
});
```## Options
This grunt task uses the native options for [xml-formatter](https://www.npmjs.com/package/xml-formatter#options).