code-formatter
v0.0.2
Published
code formatter
Downloads
161
Readme
code-formatter
code format
support landscaping and compressing code
js/html/css/json/xml/sql
usage
import formatter from 'code-formatter';
const content = `{"name":"ilex","identifier":"ac1bf435","_test":{"say":"hello","run":"fast"}}`;
const result = formatter(content, {
method: 'json'
});
// 显示
<textarea value={result} />
options
- method: String
- step:
' '
2 spaces
- preserveComments: Boolean
applies to cssmin and xmlmin functions
- tabsize: Number
- tabchar:
\t
author
ilex.h
License
MIT