https://github.com/gavinning/vpm-config
用于获取设置配置项
https://github.com/gavinning/vpm-config
Last synced: over 1 year ago
JSON representation
用于获取设置配置项
- Host: GitHub
- URL: https://github.com/gavinning/vpm-config
- Owner: gavinning
- License: gpl-3.0
- Created: 2015-07-08T11:43:04.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T12:25:08.000Z (about 8 years ago)
- Last Synced: 2025-03-23T16:03:24.709Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
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