@tng/infra

1.3.1 • Public • Published

Infra

挂载infra配置到config中去

说明

- require('@tng/infra')([config对象], [infra配置路径])
  - config: 默认空对象
  - infra配置路径: 默认`config/infra.json`
    - 支持 json, json5, js 格式

安装

yarn add @tng/infra

使用

// config

{
  a: 'a',
  b: {
    b: 'b',
    bb: 'bb'
  },
  c: {
    c: {
      c: 'c',
      cc: 'cc'
    },
    ccc: 'ccc'
  }
}

// infra

{
  b: {
    b: 'd'
  },
  c: {
    c: {
      cc: 'oo'
    }
  }
}

require('@tng/infra')(config)

config: 差异覆盖, 合并后为

{
  a: 'a',
  b: {
    b: 'd',
    bb: 'bb'
  },
  c: {
    c: {
      c: 'c',
      cc: 'oo'
    },
    ccc: 'ccc'
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @tng/infra

Weekly Downloads

0

Version

1.3.1

License

ISC

Unpacked Size

2.53 kB

Total Files

10

Last publish

Collaborators

  • aerohui
  • isayme
  • orangemi