yaml-builder
var builder = ; var root = '/controller';var template = info: version: '2.1' description: 'An amazing webapp' basePath: '/';var filter = /api/; builder;
Installation
$ npm install --save-dev yaml-builder
Features
- Find yaml files in tree directory structure
- Inline the references and base paths to avoid collisions
- Concatenate the files into a single one
- Result overriding using a template
- Filename filtering
API
configure([root], [template], [filter])
Configure the builder using the provided parameter:
root
: the root folder to find yaml files, default is the current foldertemplate
: an Object template to override attributes after the compilation processfilter
: a filter to whitelist filenames, can be an array of exact filename or a RegExp
Return the builder object.
compile(callback)
Compile all the yaml files in a directory and its sub folders.
callback
: afunction(err, result)
to callback when the compilation is over