# developer-environment

> Easy setup of developer environment

Latest version **1.0.1** (published 2021-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install developer-environment
pnpm add developer-environment
yarn add developer-environment
bun add developer-environment
```

## 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.1 |
| Published | 2021-08-12 |
| First published | 2020-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 61.1 KB |
| Known vulnerabilities | 0 (+15 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andreas Arvidsson |
| Maintainers | andreas_arvidsson |
| Keywords | developer, environment, setup |

## Links

- npm: https://www.npmjs.com/package/developer-environment
- Repository: https://github.com/AndreasArvidsson/developer-environment
- Issues: https://github.com/AndreasArvidsson/developer-environment/issues
- npm.io page: https://npm.io/package/developer-environment

## Dependencies (6)

- [ajv](https://npm.io/package/ajv.md) ^6.12.4
- [tar](https://npm.io/package/tar.md) ^6.0.5
- [owp.rm](https://npm.io/package/owp.rm.md) ^1.1.1
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.23
- [extract-zip](https://npm.io/package/extract-zip.md) ^2.0.1
- [owp.progress-promise](https://npm.io/package/owp.progress-promise.md) ^1.0.3

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-08-12
- 1.0.0 — 2020-09-14

## README

# Developer environment
Easy installation of developer environment.

## Description
1. Specify which binaries you require
1. Add configuration regarding those binaries
1. Call install()
1. Wait a few min
1. Developer environment with application server, identity provider, database and more is now installed and configured.

## Installation
```
npm install developer-environment --save
```

## Usage
```javascript
const devEnv = require("developer-environment");

const conf = {
    cwd: "envDir",                          //Optional | Default value => process.cwd()
    binaries: {
        wildfly: {
            version: "20.0.1.Final",        //Required
            debugPort: 8787,                //Optional | <= Default value
            portOffset: 0,                  //Optional | <= Default value
            username: "admin",              //Optional | <= Default value
            password: "password",           //Optional | <= Default value
            datasource: "MyDS",             //Optional | Default value => null
            memory: {
                Xms: "64m",                 //Optional | <= Default value
                Xmx: "2048m",               //Optional | <= Default value
                MetaspaceSize: "96M",       //Optional | <= Default value
                MaxMetaspaceSize: "1024m"   //Optional | <= Default value
            },            
            systemProperties: {             //Optional | Default value => { }
                "keycloak.url": "http://localhost:8081/auth" 
            },
            secureDeployments: {
                names: [ "my-app.war" ],    //Optional | Default value => [ ]
                properties: {               //Optional | Default value => { }
                    "auth-server-url": `http://localhost:8081/auth`
                }
            }
        },
        keycloak: {
            version: "11.0.0",              //Required
            portOffset: 1,                  //Optional | <= Default value
            username: "admin",              //Optional | <= Default value
            password: "password",           //Optional | <= Default value
            jsonFile: "realm.json"          //Optional | Default value => null
        },
        keycloakWildflyAdapter: {
            version: "11.0.0"               //Required
        },   
        mongodb: {
            version: "4.4.0",               //Required
            port: 27017,                    //Optional | <= Default value
            linuxDist: "ubuntu1804"         //Optional | <= Default value
        },
        mongodbDbTools: {
            version: "100.1.1",             //Required
            linuxDist: "ubuntu1804"         //Optional | <= Default value
        },
        postgresql: {
            version: "10.5-1",              //Required
            install: true,                  //Optional | <= Default value
            port: 5432,                     //Optional | <= Default value
            username: "admin",              //Optional | <= Default value
            password: "password",           //Optional | <= Default value
            db: "myDB"                      //Optional | <= Default value
        },
        jdbcPostgresql: {
            version: "42.2.5"               //Required
        }
    },
    repositories: [                         //Optional | Default value => [ ]
        {
            url: "git@github.com:AndreasArvidsson/developer-environment.git",
            cwd: __dirname
        }
    ]
};

devEnv.install(conf)
    .then(options => {
        console.log("DONE");
        //options is the config for each binary with default values added.
        console.log("Options", options);
    });
```

### Version only
If no other properties then the version is required the entire config object can be replace by the version string.    
The following two configs are equivalent.
```javascript
{
    wildfly: "20.0.1.Final"
}
{
    wildfly: {
        version: "20.0.1.Final"
    }
}
```

### Keycloak realm export
Export current keycloak realm settings as json file.
```javascript
devEnv.keycloakExport({
    version: "11.0.0",                  //Required
    realm: "MyRealm",                   //Required
    cwd: "envDir",                      //Optional | Default value => process.cwd()
    portOffset: 1,                      //Optional | <= Default value
    jsonFile: "realm.json"              //Optional | <= Default value
});
```

### Deploy to wildfly
Deploy all war files in specified dir to Wildfly.
```javascript
devEnv.deploy({
    version: "11.0.0",                  //Required
    dir: "my-app",                      //Required
    cwd: "envDir",                      //Optional | Default value => process.cwd()
    host: "localhost",                  //Optional | <= Default value
    port: 9990,                         //Optional | <= Default value
    username: "user",                   //Optional | Default value => null
    password: "password"                //Optional | Default value => null
});
```

### Un-deploy disabled
Un-deploy all disabled Wildfly deployments.
```javascript
devEnv.deploy({
    version: "11.0.0",                  //Required
    cwd: "envDir",                      //Optional | Default value => process.cwd()
    host: "localhost",                  //Optional | <= Default value
    port: 9990,                         //Optional | <= Default value
    username: "user",                   //Optional | Default value => null
    password: "password"                //Optional | Default value => null
});
```

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