1 | Specifications
|
2 | ---------
|
3 |
|
4 | <a name="spec-bud-spec"></a>
|
5 | ### Bud File Specification
|
6 |
|
7 | {{vars.bud.about}}
|
8 |
|
9 | You can specify bud data by writing `.bud` file, which is actually a javascript file and could be written in Node.js format.
|
10 |
|
11 | ```javascript
|
12 | module.exports = {
|
13 | path: 'my_file.txt',
|
14 | tmpl: '.my_file.txt.hbs',
|
15 | data: require('./.my_data')
|
16 | }
|
17 | ```
|
18 |
|
19 | And bud could be an array like:
|
20 |
|
21 | ```javascript
|
22 | module.exports = [
|
23 | { path: 'my_file.txt', /* ... */ },
|
24 | { path: 'my_other_file.txt', /* ... */ },
|
25 | ]
|
26 | ```
|
27 |
|
28 | Or an async function.
|
29 |
|
30 | ```javascript
|
31 | module.exports = function(callback){
|
32 | myAsync((data) => {
|
33 | let error = null
|
34 | callback(err, data)
|
35 | })
|
36 | }
|
37 | ```
|
38 |
|
39 | For more details, see tutorial section "[03 - Mastering coz bud][03_mastering_coz_bud_url]".
|
40 |
|
41 | ##### Supported Properties
|
42 |
|
43 | List of properties configurable in bud files.
|
44 |
|
45 | | Name | Type | Default | Description |
|
46 | | ----- | ----- | ----- | ----- |
|
47 | {{#each vars.bud.properties}}{{#if configurable}}| `{{@key}}` | {{{type}}} | {{default}} | {{description}} |
|
48 | {{/if}}{{/each}}
|
49 |
|
50 |
|
\ | No newline at end of file |