# eco2

> The module was written to simplify local development of microservices

Latest version **1.2.75** (published 2021-07-27) · 0 weekly downloads

## Install

```sh
npm install eco2
pnpm add eco2
yarn add eco2
bun add eco2
```

Provides the command `eco2`.

## 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.2.75 |
| Published | 2021-07-27 |
| First published | 2021-05-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Basov Michael |
| Maintainers | michaelbasov |

## Links

- npm: https://www.npmjs.com/package/eco2
- npm.io page: https://npm.io/package/eco2

## Dependencies (6)

- [pm2](https://npm.io/package/pm2.md) ^4.5.6
- [yarn](https://npm.io/package/yarn.md) ^1.22.10
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [inquirer](https://npm.io/package/inquirer.md) ^8.0.0
- [commander](https://npm.io/package/commander.md) ^7.2.0
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.5

## Recent versions

- 1.2.75 (latest) — 2021-07-27
- 1.2.73 — 2021-05-07
- 1.2.7 — 2021-05-07
- 1.2.63 — 2021-05-07
- 1.2.61 — 2021-05-07
- 1.2.6 — 2021-05-07
- 1.2.5 — 2021-05-07
- 1.2.3 — 2021-05-07
- 1.2.15 — 2021-05-07
- 1.2.123 — 2021-05-07
- 1.2.121 — 2021-05-07
- 1.2.12 — 2021-05-07
- 1.2.11 — 2021-05-07
- 1.2.1 — 2021-05-07
- 1.2.0 — 2021-05-07
- … 4 more at https://npm.io/package/eco2/versions

## README

## Module was inspired by architecture of mono-repositories

## Why
The module was written to simplify local development of microservices

## How
The module searches and groups the services, calls them for one window, logging in pm2

## Result
We will get comfortable using services

### install
```sh 
$ yarn global add eco2
```

### Searches modules and return app.json
```sh 
$ eco2 build
```

### Start
```sh 
$ eco2 start
```

## Commands

### init [out = app.json] - init and searches services for pm2

- -s, --search <search...>   - filter src (default: [**/applications/**, **/tools/**, **/services/**])
- -i, --ignores <ignores...> - ignore src (default: [**/node_modules/**/*])
- -c, --cwd <cwd>            - cwd src, where search

### build [out = app.json] - searches services and return out

- -s, --search <search...>    - filter src (default: [**/applications/**, **/tools/**, **/services/**])
- -i, --ignores <ignores...>  - ignore src (default: [**/node_modules/**/*])
- -c, --cwd <cwd>             - cwd src, where search

### start  [out = app.json] - it's command pm2 mutations

- -m, --modules <modules...>  - names of modules (default: [])
- -g, --groups <groups...>    - names of groups of modules (default: [])

### groups [out = app.json] - add group at out

### modules [out = app.json] - add pre modules at out

### logs [all] - it's command pm2 mutations

### stop [all] - it's command pm2 mutations

### pm2 [command] - link to pm2

What's so app.json?

```js
const app = {
    "options": { // it's global pm2 options for services
        "watch": true,
        "script": "C:\\Program Files\\nodejs\\node_modules\\eco2\\node_modules\\yarn\\bin\\yarn.js",
        "args": "debug",
        "env": {}
    },
    "modules": {
        "module-a": {
            "groups": [], // it's groups of module
            "modules": ["module-b"], // it's depends modules (relation to module-b)
            "options": { // it's local pm2 options for service
                "name": "modules-a",
                "cwd": "path/to/modules/a"
            }
        },
        "module-b": {
            "groups": [], // it's groups of module
            "modules": [], // it's depends modules
            "options": { // it's local pm2 options for service
                "name": "modules-b",
                "cwd": "path/to/modules/b"
            }
        }
    }
}
```

## [To hides windows](https://github.com/jon-hall/pm2-windows-service)

```sh 
$ yarn global add pm2-windows-service
$ pm2-service-install
```

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