xml-summary

Get a summary of an XML file in plain text.

Usage no npm install needed!

<script type="module">
  import xmlSummary from 'https://cdn.skypack.dev/xml-summary';
</script>

README

NPM version Build Status

xml-summary

Get a summary of an XML file in plain text (much like json-summary).

Particularly useful for large XML files.

Install

npm i xml-summary

Install with -g for CLI usage.

Usage

const xmlSummary = require('xml-summary');

xmlSummary('file.xml', options)
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(err);
    });

Options

Any fast-xml-parser or json-summary options.

CLI

$ xml-summary file.xml [options]

Options:
  --attrs      Include attributes in summary
  --values     Include example values
  --json       Output as parsable JSON

Example

$ xml-summary sample/email.xml
  emails:
    email: (4) [
        to: 100% <string>
        from: 100% <string>
        heading: 75.0% <string>
        body: 100% <string>
    ]

See json-summary for further examples of output.

License

MIT

Change log

  • 0.1.1 - Add basic test
  • 0.1.0 - initial version