1 | /**
|
2 | * apeman template of bud files.
|
3 | * @memberof module:apeman-tmpl-bud/lib
|
4 | * @function load
|
5 | * @param {object} params - Template params.
|
6 | * @param {string} [mode='644'] - File permission.
|
7 | * @param {boolean} [force=false] - Override or not.
|
8 | * @returns {object} - Coz bud configuration.
|
9 | */
|
10 |
|
11 |
|
12 |
|
13 | const assert = require('assert')
|
14 | const _bud = require('./_bud')
|
15 | const _tmpl = require('./_tmpl')
|
16 |
|
17 | /** @lends load */
|
18 | function load (params, mode = '644', force = false) {
|
19 | assert(params.type, 'params.type is required.')
|
20 |
|
21 | let tmpl = _tmpl(params.type)
|
22 | return _bud(tmpl, params, mode, force)
|
23 | }
|
24 |
|
25 | module.exports = load
|