# cli-to-api

> transform cli to api

Latest version **0.1.0** (published 2017-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install cli-to-api
pnpm add cli-to-api
yarn add cli-to-api
bun add cli-to-api
```

Provides the command `cli-to-api`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-08-29 |
| First published | 2017-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | akameco |
| Maintainers | akameco |
| Keywords | cli, api, cli-to-api |

## Links

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

## Dependencies (5)

- [meow](https://npm.io/package/meow.md) ^3.7.0
- [execa](https://npm.io/package/execa.md) ^0.8.0
- [listr](https://npm.io/package/listr.md) ^0.12.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.26.0
- [babel-plugin-api-over-console](https://npm.io/package/babel-plugin-api-over-console.md) ^0.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-08-29

## README

# cli-to-api [![Build Status](https://travis-ci.org/akameco/cli-to-api.svg?branch=master)](https://travis-ci.org/akameco/cli-to-api)

> transform cli to api


## Install

```
$ npm install --save-dev cli-to-api
```


## Usage

#### In

cli.js

```
console.log({ lang: 'JavaScript' })
```

### Run as CLI

```
$ node cli.js
{ lang: 'JavaScript' }
```

### Transform

```
$ cli-to-api -o server.js cli.js
```

#### Out

server.js

```js
const express = require('express');

const cors = require('cors');

const app = express();
const port = process.env.PORT || 3000;
app.use(cors());
app.get('/', (req, res) => {
  res.json({lang: 'JavaScript'});
});
app.listen(port, () => {
  console.log('listening on %s', port);
});
```


### Run as Server

```
$ node server.js
listening on 3000
```

```
$ curl localhost:3000
{
  "lang": "JavaScript"
}
```

See examples.

## License

MIT © [akameco](http://akameco.github.io)

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