# vue-formatter

> vue-beautifier for node

Latest version **0.0.11** (published 2018-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-formatter
pnpm add vue-formatter
yarn add vue-formatter
bun add vue-formatter
```

Provides the command `vue-formatter`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2018-12-22 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Marani Matias Ezequiel |
| Maintainers | matiasmarani |
| Keywords | beautify, vue, vue-beautify, vue-formatter |

## Links

- npm: https://www.npmjs.com/package/vue-formatter
- Repository: https://github.com/MaraniMatias/vue-fomatter
- Homepage: https://github.com/MaraniMatias/vue-fomatter#readme
- Issues: https://github.com/MaraniMatias/vue-fomatter/issues
- npm.io page: https://npm.io/package/vue-formatter

## Dependencies (1)

- [js-beautify](https://npm.io/package/js-beautify.md) 1.8.9

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.11 (latest) — 2018-12-22
- 0.0.10 — 2018-10-03
- 0.0.9 — 2018-09-29
- 0.0.8 — 2018-04-21
- 0.0.7 — 2017-09-04
- 0.0.6 — 2017-09-04
- 0.0.5 — 2017-09-04
- 0.0.4 — 2017-09-04

## README

# vue-formatter

vue-beautifier for node

```shell
npm install -g vue-formatter
```
## Using

### Cli
```shell
cat my-compnet.vue | vue-formatter | sponge my-compnet.vue
```
or alternatively
```shell
cat my-compnet.vue | vue-formatter > my-compnet.vue.tmp && mv my-compnet.vue.tmp my-compnet.vue
```



### JavaScript
```shell
npm install vue-formatter
```

```javascript
const formatter = require('vue-formatter');
const fs = require('fs');

fs.readFile('foo.vue', 'utf8', function (err, data) {
    if (err) { throw err; }
    console.log(formatter(data));
});
```

### Using on VIM

Key map on `.vimrc`

```shell
autocmd FileType vue noremap <buffer> <c-f> :%!vue-formatter<CR>
```

## Defaults options for JS-beautify

```json
{
  "indent_size": 2,
  "indent_char": " ",
  "indent_with_tabs": false,
  "eol": "\n",
  "end_with_newline": false,
  "indent_level": 0,
  "preserve_newlines": true,
  "max_preserve_newlines": 3,
  "space_in_paren": false,
  "space_in_empty_paren": false,
  "jslint_happy": true,
  "space_after_anon_function": true,
  "brace_style": "collapse,preserve-inline",
  "break_chained_methods": false,
  "keep_array_indentation": true,
  "unescape_strings": false,
  "wrap_line_length": 0,
  "e4x": false,
  "comma_first": false,
  "operator_position": "before-newline"
}
```

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