# @macaron-elements/compiler

> Macaron compiler

Latest version **0.3.0** (published 2022-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @macaron-elements/compiler
pnpm add @macaron-elements/compiler
yarn add @macaron-elements/compiler
bun add @macaron-elements/compiler
```

Provides the command `macaron`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2022-06-22 |
| First published | 2022-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 467 |
| Author | Ryohei Ikegami |
| Maintainers | seanchas116 |

## Links

- npm: https://www.npmjs.com/package/@macaron-elements/compiler
- Repository: https://github.com/macaron-elements/macaron
- Homepage: https://github.com/macaron-elements/macaron/tree/main/packages/compiler#readme
- Issues: https://github.com/macaron-elements/macaron/issues
- npm.io page: https://npm.io/package/@macaron-elements/compiler

## Dependencies (3)

- [slash](https://npm.io/package/slash.md) ^4.0.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.3
- [prettier](https://npm.io/package/prettier.md) ^2.7.1

## Recent versions

- 0.3.0 (latest) — 2022-06-22
- 0.1.1 — 2022-06-15
- 0.1.0 — 2022-06-12

## README

# The Macaron compiler library and command-line interface

This library / CLI is the compiler that converts [Macaron](https://macaron-elements.com/) files to Web Components.

## Installation

```bash
npm install -g @macaron-elements/compiler
```

## Usage

```bash
# compile to src/*.js
macaron src/*.macaron

# compile to src/*.js and watches for changes
macaron --watch src/*.macaron

# compile to dist/*.js
macaron --output=dist src/*.macaron
```

```
macaron [options] <file paths or glob pattern>
```

| Option       | Description                                                     |
| ------------ | --------------------------------------------------------------- |
| --watch      | Watch for changes and re-generate the component.                |
| -o, --output | Output directory. Defaults to the parent directory of the input |

## Help

```bash
macaron help
```

## API

```js
import { compile } from "@macaron-elements/compiler";

const data = fs.readFileSync("src/test.macaron", "utf-8");
const out = compile(data);
fs.writeFileSync("src/test.js", out);
```

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