Socket
Socket
Sign inDemoInstall

grunt-xml-formatter

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grunt-xml-formatter

A Grunt wrapper for the xml-formatter


Version published
Maintainers
1
Install size
120 kB
Created

Readme

Source

grunt-xml-formatter

A Grunt wrapper for xml-formatter

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a 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)

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.

Keywords

FAQs

Last updated on 23 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc