code-formatter
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i code-formatter

Weekly Downloads

45

Version

0.0.2

License

MIT

Unpacked Size

27.8 kB

Total Files

4

Last publish

Collaborators

  • ilex.h