# mikado-compile

> Template compiler for Mikado.

Latest version **0.7.58** (published 2020-08-29) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install mikado-compile
pnpm add mikado-compile
yarn add mikado-compile
bun add mikado-compile
```

Provides the command `mikado-compile`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.7.58 |
| Published | 2020-08-29 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 36.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 853 |
| Author | Thomas Wilkerling |
| Maintainers | nextapps |

## Links

- npm: https://www.npmjs.com/package/mikado-compile
- Repository: https://github.com/nextapps-de/mikado
- Homepage: https://github.com/nextapps-de/mikado/
- Issues: https://github.com/nextapps-de/mikado/issues
- npm.io page: https://npm.io/package/mikado-compile

## Dependencies (4)

- [mri](https://npm.io/package/mri.md) ^1.1.4
- [glob](https://npm.io/package/glob.md) ^7.1.5
- [totalist](https://npm.io/package/totalist.md) ^1.0.1
- [html2json](https://npm.io/package/html2json.md) ^1.0.2

## Recent versions

- 0.7.58 (latest) — 2020-08-29
- 0.7.53 — 2019-11-07
- 0.7.52 — 2019-11-07
- 0.7.51 — 2019-11-05
- 0.7.5 — 2019-11-05
- 0.7.44 — 2019-10-29
- 0.7.2 — 2019-10-26
- 0.6.5 — 2019-10-16
- 0.6.4 — 2019-10-12
- 0.6.3 — 2019-10-11
- 0.6.0 — 2019-10-05
- 0.0.6 — 2019-09-27
- 0.0.5 — 2019-09-23
- 0.0.4 — 2019-09-20
- 0.0.3 — 2019-09-18
- … 3 more at https://npm.io/package/mikado-compile/versions

## README

# Mikado Template Compiler

You will find the documentation of Mikado <a href="https://github.com/nextapps-de/mikado">here</a>.

### Install

It is recommended to install the compiler as a non-global dependency to your stack:
```cmd
npm install mikado-compile
```

### CLI

Compile a source file, takes same directory as destination:

```cmd
npx mikado-compile tpl/app.html
```

Compile a __source file__ to a given __destination folder__:
```cmd
npx mikado-compile src/tpl/app.html dest/tpl/
```

Compile a source file in a specific format:
```cmd
npx mikado-compile src/tpl/app.html json
```

Compile all files which matches a given expression:
```cmd
npx mikado-compile src/tpl/*.html
```
```cmd
npx mikado-compile src/**/*.html
```

Compile files explicitly by using option flags:
```cmd
npx mikado-compile --src src/tpl/*.html --dest dest/tpl/ --type json
```

Compile files explicitly by using option flag shortcuts:
```cmd
npx mikado-compile -s src/tpl/*.html -d dest/tpl/ -t json
```

Force overwrite existing files (silent):
```cmd
npx mikado-compile src/tpl/*.html --force
```

Compile as pretty print (non-minified):
```cmd
npx mikado-compile src/tpl/*.html --pretty
```

### Node Module

You can call the compile function directly:
```js
const compile = require("mikado-compile");
const src = "./src/*.html";
const dest = "./dist/";

compile(src, dest, {
    type: ["es5", "es6", "json"],
    force: true,
    pretty: false
});
```

### File Watcher

Start the file watcher to compile templates automatically when file contents change:
```cmd
npx mikado-compile src/tpl/*.html --watch
```

Press `CTRL + C` to stop the watcher.

__Note:__ Existing files will be overridden by default when running the watcher.

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