# mx-cli

> mx command line

Latest version **1.0.0-0** (published 2017-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install mx-cli
pnpm add mx-cli
yarn add mx-cli
bun add mx-cli
```

Provides the command `mx`.

## 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.0-0 |
| Published | 2017-10-25 |
| First published | 2017-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anton Medvedev |
| Maintainers | medv |

## Links

- npm: https://www.npmjs.com/package/mx-cli
- Repository: https://github.com/aviasales/mx
- Homepage: https://github.com/aviasales/mx#readme
- Issues: https://github.com/aviasales/mx/issues
- npm.io page: https://npm.io/package/mx-cli

## Dependencies (13)

- [mx](https://npm.io/package/mx.md) ^1.0.0-0
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [meow](https://npm.io/package/meow.md) ^3.7.0
- [chalk](https://npm.io/package/chalk.md) latest
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [chokidar](https://npm.io/package/chokidar.md) ^1.7.0
- [prettier](https://npm.io/package/prettier.md) ^1.5.2
- [columnify](https://npm.io/package/columnify.md) ^1.5.4
- [get-stdin](https://npm.io/package/get-stdin.md) ^5.0.1
- [pretty-error](https://npm.io/package/pretty-error.md) ^2.1.1
- [async-foreach](https://npm.io/package/async-foreach.md) ^0.1.3
- [stdout-stream](https://npm.io/package/stdout-stream.md) ^1.4.0
- [uppercamelcase](https://npm.io/package/uppercamelcase.md) ^3.0.0

## Recent versions

- 1.0.0-0 (latest) — 2017-10-25

## README

# mx

[![Build Status](https://travis-ci.org/aviasales/mx.svg?branch=master)](https://travis-ci.org/aviasales/mx)

> MX – Markup without jsX

## Install

```bash
npm install mx
```

### Webpack

First, let’s install the webpack loader for _mx_: 

```bash
npm install mx-loader
```

Then in `webpack.config.json` add new rule for `*.mx` filex:

```diff
  module: {
    rules: [
+     { test: /\.mx$/, use: 'mx-loader' }
    ]
  }
```

Full example [here](examples/webpack).

### Usage with create-react-app

First, let’s install the command-line interface for _mx_:

```bash
npm install mx-cli
```

Then in `package.json`, add the following lines to scripts:

```diff
   "scripts": {
+    "build-mx": "mx src/ -o src/",
+    "watch-mx": "npm run build-mx && mx src/ -o src/ --watch",
     "start": "react-scripts start",
```

As a final step, you may find it convenient to run `watch-mx` automatically with npm start, 
and run `build-mx` as a part of `npm run build`. You can use the && operator to execute two scripts sequentially. 
However, there is no cross-platform way to run two scripts in parallel, so we will install a package for this:

```bash
npm install npm-run-all
```

Then we can change start and build scripts to include the _mx_ commands:

```diff
   "scripts": {
     "build-mx": "mx src/ -o src/",
     "watch-mx": "npm run build-mx && mx src/ -o src/ --watch",
-    "start": "react-scripts start",
-    "build": "react-scripts build",
+    "start-js": "react-scripts start",
+    "start": "npm-run-all -p watch-mx start-js",
+    "build": "npm run build-mx && react-scripts build",
     "test": "react-scripts test --env=jsdom",
     "eject": "react-scripts eject"
   }
```

Now running `npm start` and `npm run build` also builds _mx_ files.

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