@qiwi/uniconfig-plugin-datatree
TypeScript icon, indicating that this package has built-in type declarations

3.5.6 • Public • Published

@qiwi/uniconfig-plugin-datatree

Uniconfig "Datatree" plugin.

Install

  npm i @qiwi/uniconfig-plugin-datatree
  yarn add @qiwi/uniconfig-plugin-datatree

Usage

import {Config, addPlugin} from '@qiwi/uniconfig-core'
import dataTreePlugin from '@qiwi/uniconfig-plugin-datatree'

addPlugin(dataTreePlugin)

const config = new Config({
  data: {
    someParam: '$foo:bar',
    otherParam: '$a:b',
    anotherParam: '$a:d.e.f.g',
    lastParam: '$a:i.j.k.l.m.n'
  },
  source: {
    foo: {
      data: {
        bar: 'baz'
      }
    },
    a: {
      data: {
        b: 'c',
        'd.e.f.g': 'h',
        'i.j': {
          k: {
            'l.m.n': 'o'
          }
        }
      }
    }
  }
}, {
  pipeline: 'datatree',
  mode: 'sync'
})

config.get('someParam')     // 'baz'
config.get('otherParam')    // 'c'
config.get('anotherParam')  // 'h'
config.get('lastParam')     // 'o'

Package Sidebar

Install

npm i @qiwi/uniconfig-plugin-datatree

Weekly Downloads

27

Version

3.5.6

License

MIT

Unpacked Size

19.8 kB

Total Files

9

Last publish

Collaborators

  • antongolub
  • qiwibot