better-xml-formatter
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

better-xml-formatter

Hi. This is a library that can be used to automaticaly format XML files.

Usage

First install the package

$ npm install better-xml-formatter

Then import the main function into your code:

import formatXMLString from 'better-xml-formatter';

const { formatted, message } = formatXMLString(``, 4, 120);
if (formatted) {
  console.log(formatted);
}

The first argument is the string you want to format. The second one is the amount of spaces you want to use at each indentation level. The third one is the maximum line size you want.

The function returns the formatted text inside an object.

Readme

Keywords

Package Sidebar

Install

npm i better-xml-formatter

Weekly Downloads

0

Version

3.0.3

License

MIT

Unpacked Size

15.9 kB

Total Files

19

Last publish

Collaborators

  • caillouplus