# vue-tools-split

> Split a `.vue` file into `script.js`, `style.css` and `template.html`.

Latest version **1.0.1** (published 2018-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-tools-split
pnpm add vue-tools-split
yarn add vue-tools-split
bun add vue-tools-split
```

## 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.0.1 |
| Published | 2018-02-26 |
| First published | 2018-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joaquín Fernández |
| Maintainers | joaquinfq |
| Keywords | vue, vue-cli, vue-split, vue-tools, vue-utils |

## Links

- npm: https://www.npmjs.com/package/vue-tools-split
- Repository: https://github.com/joaquinfq/vue-tools-split
- Homepage: http://www.joaquinfernandez.net
- Issues: https://github.com/joaquinfq/vue-tools-split/issues
- npm.io page: https://npm.io/package/vue-tools-split

## Recent versions

- 1.0.1 (latest) — 2018-02-26
- 1.0.0 — 2018-02-26

## README

# vue-tools-split [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install vue-tools-split](https://nodei.co/npm/vue-tools-split.png?compact=true)](https://npmjs.org/package/vue-tools-split/)

Split a `.vue` file into `script.js`, `style.css` and `template.html`.

## Example

Input component:

```
// MyCmp.vue
<template>
    <div class="my-cmp">MyCmp</div>
</template>
<script>
    export {
        name : 'my-cmp'
    }
</script>
<style>
    .my-cmp {
        margin : 5px;
    }
</style>
```

Script:

```js
const vueToolsSplit = require('vue-tools-split');
const sections      = vueToolsSplit.fromFile('MyCmp.vue');
console.log(sections);
// { vue: '<template src="./template.html" />\n<script   src="./script.js"     />\n<style    src="./style.css"     />\n',
//   template: '    <div class="my-cmp">MyCmp</div>',
//   script: '    export {\n        name : \'my-cmp\'\n    }',
//   style: '    .my-cmp {\n        margin : 5px;\n    }' }
//------------------------------------------------------------------------------
// Write result to files.
//------------------------------------------------------------------------------
vueToolsSplit.write(sections);
// ├── index.vue
// ├── script.js
// ├── style.css
// └── template.html
```

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