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

https://github.com/gavinning/vpm-config

用于获取设置配置项
https://github.com/gavinning/vpm-config

Last synced: over 1 year ago
JSON representation

用于获取设置配置项

Awesome Lists containing this project

README

          

# Config

配置文件管理

### Install

```sh
npm i vpm-config
```

### Usage
```javascript
const Config = require('vpm-config')
const config = new Config({})
```
### Example
```javascript
config.set('dev.db.username', 'root')
config.set('dev.db.password', 'root')

config.get('dev.db.username')
config.get('dev.db.password')
```

```js
config.merge({
app: {
name: 'name',
logo: 'logo',
tags: [1,2,3],
mods: {
foo: 'bar'
}
}
})

config.get('app.name')
config.get('app.mods.foo')
```

```js
config.merge('app.mods', {
bar: 'foo'
})

config.get('app.mods')
```

> npm run test