# api-console-dependency-manager

> Module to detect and install Mulesoft's API console dependencies.

Latest version **1.0.2** (published 2018-10-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install api-console-dependency-manager
pnpm add api-console-dependency-manager
yarn add api-console-dependency-manager
bun add api-console-dependency-manager
```

## 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.2 |
| Published | 2018-10-31 |
| First published | 2017-08-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.5.0 |
| Dependencies | 3 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Pawel Psztyc, Advanced Rest Client Authors |
| Maintainers | jarrodek, mulesoft-npm |
| Keywords | api-console, builder, node, bower, dependencies |

## Links

- npm: https://www.npmjs.com/package/api-console-dependency-manager
- Repository: https://github.com/mulesoft-labs/api-console-dependency-manager
- Homepage: https://github.com/mulesoft-labs/api-console-dependency-manager#readme
- Issues: https://github.com/mulesoft-labs/api-console-dependency-manager/issues
- npm.io page: https://npm.io/package/api-console-dependency-manager

## Dependencies (3)

- [bower](https://npm.io/package/bower.md) ^1.8.4
- [winston](https://npm.io/package/winston.md) 3.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^3.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-10-31
- 1.0.1 — 2018-07-01
- 1.0.0 — 2018-05-31
- 0.1.2 — 2017-11-14
- 0.1.1 — 2017-08-11
- 0.1.0 — 2017-08-05

## README

# api-console-dependency-manager

![Warning][warning] ![Warning][warning] ![Warning][warning] ![Warning][warning]

Moved to: https://www.npmjs.com/package/@api-components/api-console-dependency-manager

Do not use this version in new projects.

![Warning][warning] ![Warning][warning] ![Warning][warning] ![Warning][warning]

https://travis-ci.org/advanced-rest-client/api-console-dependency-manager.svg?branch=master

A npm module to detect and install Mulesoft's API console dependencies.

This module is mainly used in the [api-console-builder](https://github.com/mulesoft-labs/api-console-builder).

## API

Shorthand functions:

-   `installDependencies(workingDir, logger, opts)` -> `new DependendenciesManager#installDependencies(workingDir, logger, opts)`

The module exposes 2 classes:

-   [DependendenciesManager](lib/dependencies.js)
-   [DependenciesOptions](lib/dependencies-options.js)

### Example

```javascript
const consoleDependencies = require('api-console-dependency-manager');

consoleDependencies.installDependencies('./build/', console, {
  verbose: true,
  parser: true,
  app: true
})
.then(() => console.log('Dependencies are now installed'))
.catch(cause => console.error(cause));
```

equivalent to

```javascript
const {DependendenciesManager, DependenciesOptions} = require('api-console-github-resolver');

const options = new DependenciesOptions({
  verbose: true,
  parser: true,
  app: true
});
const workingDir = './build/';
const logger = console; // Winston or other with console like interface
const manager = new DependendenciesManager(workingDir, logger, options);
manager.installDependencies()
.then(() => console.log('Dependencies are now installed'))
.catch(cause => console.error(cause));
```

### DependenciesOptions

| Property | Type | Default | Description |
| -------- | -------- | -------- | -------- |
| `verbose` | `Boolean` | `false` | Prints verbose output while installing dependencies. This is used to build install command for bower which is printing console output by default. |
| `parser` | `Boolean` | `false` | If set it installs RAML javascript parser with the enhancer. **Deprecated**: This option is only relevant for the console version 4. It may be removed in future releases. **Set `isV4` option when using this one.** |
| `app` | `Boolean` | `false` | If set it installs `app-route` element to support standalone application architecture of the API console. **Deprecated**: This option is only relevant for the console version 4. It may be removed in future releases. **Set `isV4` option when using this one.** |
| `isV4` | `Boolean` | `false` | Compatibility mode with API console version 4. If set then it works as module created for v4 (versions 0.x.x of the module) |
| `optionalDependencies` | `Array<String>` | `undefined` | List of optional dependencies to install besides the ones installed with bower file. It contains the list to of bower dependencies as it would be defined in `bower.json` file. This isn relevant for console v5 build process which manages dependencies differently. |

### DependendenciesManager

#### Constructor

##### Arguments

| Property | Type | Description |
| -------- | -------- | -------- |
| `workingDir` | `String` | Path to a working directory where the console is processed. Usually it's where the `bower.json` file is. |
| `options` | `Object` or `DependenciesOptions` | Build options passed to the module. |
| `logger` | `Object` | Any logger with the interface compatible with platform's `console` object. |

#### `installDependencies()`

Installs dependencies in the `workingDir`.

##### Return <Promise>

Resolved promise when operation is completed.

## Changes in stable version

- Order of arguments is reversed
- It uses locally installed Bower dependency and does not checks if bower is installed on local machine.
- Now additional dependencies has to be defined in the configuration options

[warning]: warning-icon.png "Warning"

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