xml-summary

0.1.1 • Public • Published

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

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i xml-summary

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    6.37 kB

    Total Files

    6

    Last publish

    Collaborators

    • moos