xml-but-prettier

WebJar for xml-but-prettier

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

xml-but-prettier
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

xml-but-prettier
WebJar for xml-but-prettier
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/shockey/xml-but-prettier

Download xml-but-prettier

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/xml-but-prettier/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>xml-but-prettier</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/xml-but-prettier/
implementation 'org.webjars.npm:xml-but-prettier:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/xml-but-prettier/
implementation ("org.webjars.npm:xml-but-prettier:1.0.1")
'org.webjars.npm:xml-but-prettier:jar:1.0.1'
<dependency org="org.webjars.npm" name="xml-but-prettier" rev="1.0.1">
  <artifact name="xml-but-prettier" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='xml-but-prettier', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "xml-but-prettier" % "1.0.1"
[org.webjars.npm/xml-but-prettier "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : repeat-string jar [1.5.2,2)

Project Modules

There are no modules declared in this project.

XML, But Prettier

Build Status NPM version

This module is a fork of jonathanp/xml-beautifier.

This module beautifies XML documents by putting each tag and text node on their own line and correctly indenting everything.

Can be used e.g. if you're using React as a static page generator and (for some reason) need the generated HTML to be more human-readable.

Install

$ npm install --save xml-but-prettier

Usage

The module's function signature is xmlButPrettier(xml:String, options:Object).

import xmlButPrettier from 'xml-but-prettier';

const xml = xmlButPrettier('<div><span>foo</span></div>');
console.log(xml); // => will output correctly indented elements

Options

  • indentor: a custom string to use for indenting things
  • textNodesOnSameLine: compresses text nodes onto the same line as their containing tags

License

MIT.

Versions

Version
1.0.1