call_with_config

call with config

Usage no npm install needed!

<script type="module">
  import callWithConfig from 'https://cdn.skypack.dev/call_with_config';
</script>

README

call_with_config

call funtion with config(json object)

gitter NPM version Build codecov.io js-standard-style

Install

$ npm i -S call_with_config@2

API

call_with_config(key, config, cumtomKey)

  • key = module name or local module
  • config for param
  • if cumtomKey exist, load config from config[cumtomKey]

Usages

var call_with_config = require('.')

var r = call_with_config('./favicon', {
  './favicon':{
    'path': 'sss'
  },
  'empty-favicon':{
    
  }
});

console.dir(r.toString())

or

var call_with_config = require('.')

var r = call_with_config('koa-favicon', {
  'koa-favicon':{
    'path': 'sss',
    'options': {
      'maxAge': 1
    }
  }
});

console.dir(r.toString())