# @janiscommerce/settings

> [![Build Status](https://travis-ci.org/janis-commerce/settings.svg?branch=master)](https://travis-ci.org/janis-commerce/settings) [![Coverage Status](https://coveralls.io/repos/github/janis-commerce/settings/badge.svg?branch=master)](https://coveralls.io/

Latest version **1.0.1** (published 2019-07-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @janiscommerce/settings
pnpm add @janiscommerce/settings
yarn add @janiscommerce/settings
bun add @janiscommerce/settings
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-07-17 |
| First published | 2019-07-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Janis |
| Maintainers | janiscommerce |

## Links

- npm: https://www.npmjs.com/package/@janiscommerce/settings
- Repository: https://github.com/janis-commerce/settings
- Homepage: https://github.com/janis-commerce/settings.git#readme
- Issues: https://github.com/janis-commerce/settings/issues
- npm.io page: https://npm.io/package/@janiscommerce/settings

## Recent versions

- 1.0.1 (latest) — 2019-07-17
- 1.0.0 — 2019-07-04

## README

# settings

[![Build Status](https://travis-ci.org/janis-commerce/settings.svg?branch=master)](https://travis-ci.org/janis-commerce/settings)
[![Coverage Status](https://coveralls.io/repos/github/janis-commerce/settings/badge.svg?branch=master)](https://coveralls.io/github/janis-commerce/settings?branch=master)

## Installation
```bash
npm install @janiscommerce/settings
```

## API

### Settings.get(string) **static**
- This method returns settings or settings by key.
**Example:** Settings.get();
**Example:** Settings.get('database');

## Setting file

The setting file is a JSON with all the settings.

It's located in `path/to/root/[MS_PATH]/config/.janiscommercerc.json`.

`[MS_PATH]` : ENV variable. Default is empty.


### Example
```json
{
	"database": {
		"core": {
			"host": "my-host",
			"user": "the-user"
		},
		"otherConn": {
			"host": "my-other-host",
			"user": "other-user"
		}
	},
	"otherConfig": 123,
	"mainPath": "/main/path/"
}
```

## Usage

### How to get settings

```js
const Settings = require('janiscommerce/settings');

const settings = Settings.get();
```

### How to get settings by key

```js
const Settings = require('janiscommerce/settings');

const settings = Settings.get('database');
```

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