Manual JavaScript setup
Ink requires the same Babel setup as you would do for regular React-based apps in the browser.
Set up Babel with a React preset to ensure all examples in this readme work as expected.
After [installing Babel](https://babeljs.io/docs/en/usage), install `@babel/preset-react` and insert the following configuration in `babel.config.json`:
```sh
npm install --save-dev @babel/preset-react
```
```json
{
"presets": ["@babel/preset-react"]
}
```
Next, create a file `source.js`, where you'll type code that uses Ink:
```jsx
import React from 'react';
import {render, Text} from 'ink';
const Demo = () => Hello World;
render();
```
Then, transpile this file with Babel:
```sh
npx babel source.js -o cli.js
```
Now you can run `cli.js` with Node.js:
```sh
node cli
```
If you don't like transpiling files during development, you can use [import-jsx](https://github.com/vadimdemedes/import-jsx) or [@esbuild-kit/esm-loader](https://github.com/esbuild-kit/esm-loader) to `import` a JSX file and transpile it on the fly.
Ink uses [Yoga](https://github.com/facebook/yoga), a Flexbox layout engine, to build great user interfaces for your CLIs using familiar CSS-like properties you've used when building apps for the browser.
It's important to remember that each element is a Flexbox container.
Think of it as if every `