Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthewmueller/pretty-html
HTML logging that's easy on the eyes.
https://github.com/matthewmueller/pretty-html
Last synced: about 1 month ago
JSON representation
HTML logging that's easy on the eyes.
- Host: GitHub
- URL: https://github.com/matthewmueller/pretty-html
- Owner: matthewmueller
- Created: 2014-01-30T18:52:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-04T15:11:59.000Z (almost 11 years ago)
- Last Synced: 2024-04-08T20:10:08.664Z (7 months ago)
- Language: JavaScript
- Homepage: http://matthewmueller.github.io/pretty-html/
- Size: 191 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# pretty-html
html logging that's easy on the eyes.
**HTML View:**
![html view](https://i.cloudup.com/6zFvalrj3D.png)
**Text View:**
![text view](https://i.cloudup.com/3v6N5qYaMv.png)
## Installation
Install with [component(1)](http://component.io):
$ component install matthewmueller/pretty-html
Or with node:
$ npm install pretty-html
## Example
```js
// html format
out.innerHTML = pretty(document.body).html();// text format
console.log(pretty(document.body).text());
```## API
### `pretty(dom)`
Add the DOM node you want to format.
### `pretty.html()`
Return a formatted html string of the element, showing all text and element nodes. The output's style is completely customizable. Take a look at `pretty.css` to see some of the options.
### `pretty.text()`
Return a formatted text string of the element, showing all text and element nodes.
## License
MIT