# js-to-beautify

> You are free to use this in any way you want, in case you find this useful or working for you.

Latest version **1.1.2** (published 2018-07-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install js-to-beautify
pnpm add js-to-beautify
yarn add js-to-beautify
bun add js-to-beautify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2018-07-30 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shangri-la |
| Maintainers | shangri_la |

## Links

- npm: https://www.npmjs.com/package/js-to-beautify
- npm.io page: https://npm.io/package/js-to-beautify

## Recent versions

- 1.1.2 (latest) — 2018-07-30
- 1.1.1 — 2018-07-25
- 1.1.0 — 2018-07-25
- 1.0.9 — 2018-07-25
- 1.0.8 — 2018-07-25
- 1.0.7 — 2018-07-25
- 1.0.6 — 2018-07-25
- 1.0.5 — 2018-07-25
- 1.0.4 — 2018-07-25
- 1.0.3 — 2018-07-25
- 1.0.2 — 2018-07-25
- 1.0.1 — 2018-07-25
- 1.0.0 — 2018-07-25

## README

# js-to-beautify

![npm](https://nodei.co/npm/markdown-editor-vue.png?downloads=true&downloadRank=true&stars=true)

![npm star](https://img.shields.io/amo/stars/dustman.svg) ![](https://img.shields.io/badge/test-public%20-orange.svg)

> 格式化js代码


### Install npm i js-to-beautify(安装)

```
$ npm install js-to-beautify --save
```

### Use (如何引入)
```
/**
 * Created by shangri-la on 25/07/2018.
 * You are free to use this in any way you want, in case you find this useful or working for you.
 *
 * Usage:
 * js_source_text   :  需要格式化的内容
 * indent_size      :  默认是4个缩进,
 * indent_character :  默认是 " "
 * indent_level     :  代码距离左侧的距离 默认是 0
 *
 * jsToBeautify(js_source_text,[indent_size, indent_character, indent_level]);
 */

```

###### Script tag

```
   //  引入jsToBeautify.js
   <script src="node_modules/js-to-beautify/src/jsToBeautify.js"></script>


```

###### Babel
Babel is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.

```
  import jsToBeautify from "js-to-beautify";

```


###### Browserify/Webpack
There are several ways to use Browserify and Webpack. For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...
```
  var jsToBeautify = require("js-to-beautify");
  var jtb = jsToBeautify(js_source_text,[indent_size, indent_character, indent_level]); // []里是可选项可以不写
  console.log(jtb) // 格式好的数据
```

### 注

```
[indent_size, indent_character, indent_level]里是可选项可以不写
```



## Collaborators(合作者)

- [CHENXCHEN](https://github.com/CHENXCHEN)


## Licence (证书)

Copyright (c) 2017 Shangri-la

---
_Source: https://npm.io/package/js-to-beautify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
