# express-me

> Create ExpressJS apps with the most common modules initialized automatically.

Latest version **3.0.9** (published 2017-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-me
pnpm add express-me
yarn add express-me
bun add express-me
```

## 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 | 3.0.9 |
| Published | 2017-05-29 |
| First published | 2017-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Known vulnerabilities | 0 (+13 in 2 direct dependencies) |
| Install scripts | no |
| Author | Ion Suman |
| Maintainers | sumanion |

## Links

- npm: https://www.npmjs.com/package/express-me
- Repository: https://github.com/103058/express-me
- Homepage: https://github.com/103058/express-me#readme
- Issues: https://github.com/103058/express-me/issues
- npm.io page: https://npm.io/package/express-me

## Dependencies (16)

- [pug](https://npm.io/package/pug.md) ^2.0.0-rc.1
- [i18n](https://npm.io/package/i18n.md) ^0.8.3
- [debug](https://npm.io/package/debug.md) ^2.6.6
- [helmet](https://npm.io/package/helmet.md) ^3.6.0
- [morgan](https://npm.io/package/morgan.md) ^1.8.2
- [express](https://npm.io/package/express.md) ^4.15.2
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.8.3
- [mongoose](https://npm.io/package/mongoose.md) ^4.9.7
- [cdnjs-env](https://npm.io/package/cdnjs-env.md) ^1.0.0
- [detect-ip](https://npm.io/package/detect-ip.md) ^1.0.1
- [ip-country](https://npm.io/package/ip-country.md) ^1.0.2
- [compression](https://npm.io/package/compression.md) ^1.6.2
- [local-price](https://npm.io/package/local-price.md) ^1.0.2
- [report-error](https://npm.io/package/report-error.md) ^1.0.7
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.3
- [express-asset-versions](https://npm.io/package/express-asset-versions.md) ^0.1.2

## Recent versions

- 3.0.9 (latest) — 2017-05-29
- 3.0.8 — 2017-05-29
- 3.0.7 — 2017-05-29
- 3.0.6 — 2017-05-29
- 3.0.5 — 2017-05-29
- 3.0.4 — 2017-05-29
- 3.0.3 — 2017-05-29
- 3.0.2 — 2017-05-29
- 3.0.1 — 2017-05-29
- 3.0.0 — 2017-05-29
- 2.1.0 — 2017-05-19
- 2.0.0 — 2017-05-15
- 1.1.1 — 2017-05-09
- 1.1.0 — 2017-05-07
- 1.0.0 — 2017-05-07

## README

# Express Me

Create production-ready ExpressJS applications
with the most common modules initialized automatically.

## Installation

Using npm:

```bash
$ npm install express-me --save
```

Using yarn:

```bash
$ yarn add express-me
```

## Usage

```js
// Load the module.
const expressMe = require('express-me')

// See #options for more details about accepted options.
let options = {}

// Create the Express application with custom options.
expressMe(options, (app, http) => {

  // Register application specific routes and middleware.
})

// Or, you can use production-ready defaults.
expressMe((app, http) => {

  // Register application specific routes and middleware.
})

// The `http` argument is the HTTP Server, and it is passed to the callback because
// you may need it for example to setup SocketIO, but you can skip it.
expressMe(app => {

  // Register application specific routes and middleware.
})
```

## Options

Here is a list of available options:

#### - `bugsnag`

Specifies if to send errors to [Bugsnag](https://www.bugsnag.com/).
Uses the [report-error](https://www.npmjs.com/package/report-error) module.

Accepts one of the following values:

- `false` - disable this feature.
- `String` - enable this feature and use provided value as the *Bugsnag API key*.

*Default value: `false`*

---

### - `morgan`

Specifies if to use [morgan](https://www.npmjs.com/package/morgan) logger.

Accepts one of the following values:

- `false` - disable logger.
- `true` - enable a default logger when in development mode.
- `String` - enable logger with given format.
- `Object` - enable logger with given `format` and `options` arguments.

*Default value: `true`*

---

#### - `db`

Specifies if to connect to the database using
[mongoose](https://www.npmjs.com/package/mongoose) module.

Accepts one of the following values:

- `false` - disable this feature.
- `Object` - enable this feature and connect using provided connection details.

*Default value: `false`*

Connection details object structure:

```json
{
  "host": "127.0.0.7",
  "port": 27017,
  "name": "database_name"
}
```

---

#### - `helmet`

Specifies if to initialize [helmet](https://www.npmjs.com/package/helmet) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize helmet with default options.
- `Object` - enable this feature and initialize using provided helmet options.

*Default value: `true`*

For more details about helmet options
see [helmet](https://www.npmjs.com/package/helmet) module.

---

#### - `compression`

Specifies if to initialize [compression](https://www.npmjs.com/package/compression) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize compression with default options.
- `Object` - enable this feature and initialize using provided compression options.

*Default value: `true`*

For more details about compression options
see [compression](https://www.npmjs.com/package/compression) module.

---

#### - `static`

Specify static directories.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and use default static directories.
- `String`, `Array` - enable this feature and use provided static directories.

*Default value: `true`*

```js
let staticDirectories = [
  path.join(process.cwd(), 'client', 'dist'),
  path.join(process.cwd(), 'client', 'dist', 'favicon')
]
```

---

#### - `staticPrefix`

Specify if to use a prefix for static files.

Accepts one of the following values:

- `undefined` - do not use a prefix.
- `String` - use it's value as a prefix.

*Default value: `undefined`*

---

#### - `assetVersions`

Specifies it to use the
[express-asset-versions](https://www.npmjs.com/package/express-asset-versions)
module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and use a default directory.
- `String` - enable this feature and use provided value as a directory.

*Default value: `true`*

```js
let assetPath = path.join(process.cwd(), 'client', 'dist')
```

For more details see
[express-asset-versions](https://www.npmjs.com/package/express-asset-versions)
module.

---

#### - `views`

Specify the directory or directories for the views.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and use a default directory.
- `String`, `Array` - enable this feature and use provided directories.

*Default value: `true`*

```js
let viewsPath = path.join(process.cwd(), 'views')
```

---

#### - `viewEngine`

Specify the view engine of the application.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and use a default view engine.
- `String` - enable this feature and use provided view engine.

*Default value: `true`*

```js
let viewEngine = 'pug'
```

---

#### - `cookies`

Specifies if to initialize [cookie-parser](https://www.npmjs.com/package/cookie-parser) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize cookie-parser with default options.
- `String` - enable this feature and initialize using provided secret.

*Default value: `true`*

For more details about cookie-parser options
see [cookie-parser](https://www.npmjs.com/package/cookie-parser) module.

---

#### - `detectIp`

Specifies if to initialize [detect-ip](https://www.npmjs.com/package/detect-ip) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize detect-ip with default options.
- `Object` - enable this feature and initialize using provided options.

*Default value: `true`*

For more details about detect-ip options
see [detect-ip](https://www.npmjs.com/package/detect-ip) module.

---

#### - `ipCountry`

Specifies if to initialize [ip-country](https://www.npmjs.com/package/ip-country) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize ip-country with default options.
- `Object` - enable this feature and initialize using provided options.

*Default value: `true`*

For more details about ip-country options
see [ip-country](https://www.npmjs.com/package/ip-country) module.

---

#### - `i18n`

Specifies if to initialize [i18n](https://www.npmjs.com/package/i18n) module.

Accepts one of the following values:

- `false` - disable this feature.
- `Object` - enable this feature and initialize using provided options.

*Default value: `false`*

For more details about i18n options
see [i18n](https://www.npmjs.com/package/i18n) module.

---

#### - `cdnjs`

Specifies if to initialize [cdnjs-env](https://www.npmjs.com/package/cdnjs-env) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize cdnjs-env with default options.

*Default value: `true`*

For more details about cdnjs-env options
see [cdnjs-env](https://www.npmjs.com/package/cdnjs-env) module.

---

#### - `localPrice`

Specifies if to initialize [local-price](https://www.npmjs.com/package/local-price) module.

Accepts one of the following values:

- `false` - disable this feature.
- `true` - enable this feature and initialize local-price with default options.
- `String` - enable this feature and set the given default currency.

*Default value: `true`*

---

### - `errorHandler`

Define a custom error handler.
[more details](http://expressjs.com/en/guide/error-handling.html)

- Must be a `Function`.

> When not provided a default error handler is used.

### - `errorView`

Specify a full path to a view which will be rendered on errors.

- Must be a `String`.

> When not provided a default error handler is used.

---

### - `port`

Specify a port for the application.

- Must be a `Number`.

*Default value: `3000`*

## Used modules

- [morgan](https://www.npmjs.com/package/morgan)
- [mongoose](https://www.npmjs.com/package/mongoose)
- [report-error](https://www.npmjs.com/package/report-error)
- [helmet](https://www.npmjs.com/package/helmet)
- [compression](https://www.npmjs.com/package/compression)
- [cookie-parser](https://www.npmjs.com/package/cookie-parser)
- [express-asset-versions](https://www.npmjs.com/package/express-asset-versions)
- [cdnjs-env](https://www.npmjs.com/package/cdnjs-env)
- [ip-country](https://www.npmjs.com/package/ip-country)
- [detect-ip](https://www.npmjs.com/package/detect-ip)
- [local-price](https://www.npmjs.com/package/local-price)
- [i18n](https://www.npmjs.com/package/i18n)

## License

The MIT License (MIT)

Copyright (c) 2017 Ion Suman <sumanion122@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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