Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vladimyr/pm2-conf


https://github.com/vladimyr/pm2-conf

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# pm2-conf

[![build status](https://badgen.net/travis/vladimyr/pm2-conf/master)](https://travis-ci.com/vladimyr/pm2-conf) [![install size](https://badgen.net/packagephobia/install/{{name})](https://packagephobia.now.sh/result?p={{name}) [![npm package version](https://badgen.net/npm/v/pm2-conf)](https://npm.im/pm2-conf) [![github license](https://badgen.net/github/license/vladimyr/pm2-conf)](https://github.com/vladimyr/pm2-conf/blob/master/LICENSE) [![js semistandard style](https://badgen.net/badge/code%20style/semistandard/pink)](https://github.com/Flet/semistandard)

> Build [PM2](https://github.com/Unitech/pm2) ecosystem config

## Install

$ npm i vladimyr/pm2-conf

## Usage

Modify your `ecosystem.config.js`:

```js
module.exports = require('pm2-conf')({
// `name` is determined from `package.json`'s `name` property
script: require.resolve('./server')
});
```

## API

#### Table of Contents

- [buildConfig](#buildconfig)
- [Parameters](#parameters)
- [Examples](#examples)
- [StartOptions](#startoptions)

### buildConfig

Builds pm2 ecosystem configuration

#### Parameters

- `options` **[StartOptions](#startoptions)** app start options (optional, default `{}`)

#### Examples

```javascript
const buildConfig = require('pm2-conf');
buildConfig({ name: 'my-app', script: require.resolve('./server') });
//=> pm2 ecosystem configuration
```

Returns **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[StartOptions](#startoptions)>** pm2 configuration

### StartOptions

- **See: **