New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qiwi/uniconfig-core

Package Overview
Dependencies
Maintainers
5
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qiwi/uniconfig-core

Core uniconfig library

  • 3.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-56.76%
Maintainers
5
Weekly downloads
 
Created
Source

@qiwi/uniconfig-core

Core uniconfig layer: basic ifaces, utils, entry point, plugin API

Install

  npm i @qiwi/uniconfig-core
  yarn add @qiwi/uniconfig-core

Plugin API

uniconfig features may be significantly extended with plugins.

import uniconfig, {rollupPlugin} from '@qiwi/uniconfig-core'
import uniconfigPluginFile from '@qiwi/uniconfig-plugin-api-file'    
import uniconfigPluginYaml from '@qiwi/uniconfig-plugin-yaml'    
import uniconfigPluginDatatree from '@qiwi/uniconfig-plugin-datatree'    

rollupPlugin(uniconfigPluginFile)
rollupPlugin(uniconfigPluginYaml)
rollupPlugin(uniconfigPluginDatatree)
const config = uniconfig('./foobar.yml', {mode: 'sync', pipeline: 'file>yaml>datatree'})    

Each plugin should expose at least two methods to be registered: rollup and rollback.

export interface IContext {
  pipe: IRegistry
}

export interface IPlugin {
  rollback(context: IContext): void,
  rollup(context: IContext): void
}

IPipe with additional name field is also provided as plugin declaration:

  const name = 'test'
  const pipe = {
    handle() {},
    handleSync() {}
  }
  const pipeAsPlugin = {...pipe, name}
  
  rollupPlugin(pipeAsPlugin)
  context.pipe.get(name)  // IPipe

Example

{
  "data": {
    "foo": "bar",
    "baz": 1,
    "host": "$remoteConfig.hostname",
    "port": "$jsonFile.defaultPort"
  },
  "sources": {
     "jsonFile": {"pipeline": "file>json", "data": "./foo.json"},
     "yamlFile": {"pipeline": "file>yaml", "data": "./bar.yaml"},
     "remoteConfig": {"pipeline": "http>json", "data": "https://reqres.in/api/users/2"}
  }
}

Keywords

FAQs

Package last updated on 29 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc