Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xml-but-prettier

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-but-prettier

Beautifies XML documents by putting each tag and text node on their own line and correctly indents everything

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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-beautifier

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.

FAQs

Package last updated on 02 Nov 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc