pretty

WebJar for pretty

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

pretty
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

pretty
WebJar for pretty
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jonschlinkert/pretty

Download pretty

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : condense-newlines jar [0.2.1,0.3)
org.webjars.npm : extend-shallow jar [2.0.1,3)
org.webjars.npm : js-beautify jar [1.6.12,2)

Project Modules

There are no modules declared in this project.

pretty NPM version NPM monthly downloads Linux Build Status

Some tweaks for beautifying HTML with js-beautify according to my preferences.

Install

Install with npm:

$ npm install --save pretty

Install with yarn:

$ yarn add pretty

Usage

var pretty = require('pretty');

pretty(STRING_OF_HTML);

Before

<!DOCTYPE html> <html lang="en"> <head> 
<meta charset="UTF-8"> <title>Home</title> 
</head> <body> This is content. </body> </html>

After

<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Home</title>
  </head>
  <body>
    This is content.
  </body>
</html>

Options

ocd

pretty(STRING_OF_HTML, {ocd: true});

Type: Boolean

Default: undefined

  • condenses multiple newlines to a single newline
  • trims leading and trailing whitespace
  • ensures that a trailing newline is inserted
  • normalizes whitespace before code comments

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.5.0, on April 13, 2017.

Versions

Version
2.0.0